diff options
author | Zach Copley <zach@status.net> | 2010-02-05 03:19:12 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-05 03:19:12 +0000 |
commit | 23802e58d6d01e5f8dacade2161147d31b2dacb9 (patch) | |
tree | 707120cc8d2d0217e4168473b7a7ef25e94919e0 /actions/newapplication.php | |
parent | 4502bea9a86fe5992eb9b359d90f0c1f004998c1 (diff) | |
parent | 857494c9c61d872b7decf69de226bba6cd250d99 (diff) |
Merge branch 'temp'
Diffstat (limited to 'actions/newapplication.php')
-rw-r--r-- | actions/newapplication.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actions/newapplication.php b/actions/newapplication.php index c499fe7c7..c0c520797 100644 --- a/actions/newapplication.php +++ b/actions/newapplication.php @@ -158,6 +158,9 @@ class NewApplicationAction extends OwnerDesignAction if (empty($name)) { $this->showForm(_('Name is required.')); return; + } else if ($this->nameExists($name)) { + $this->showForm(_('Name already in use. Try another one.')); + return; } elseif (mb_strlen($name) > 255) { $this->showForm(_('Name is too long (max 255 chars).')); return; @@ -273,5 +276,22 @@ class NewApplicationAction extends OwnerDesignAction } + /** + * Does the app name already exist? + * + * Checks the DB to see someone has already registered an app + * with the same name. + * + * @param string $name app name to check + * + * @return boolean true if the name already exists + */ + + function nameExists($name) + { + $app = Oauth_application::staticGet('name', $name); + return ($app !== false); + } + } |