]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
converted more to dbm::is_result() + added braces/space
[friendica.git] / include / api.php
index 2ae1aeaa026e25e9f8c7fbca5b7d0bb61ec4aa79..a450f867a574e45edce018014a10be5944b86cc7 100644 (file)
         * @hook 'logged_in'
         *              array $user     logged user record
         */
-       function api_login(&$a){
+       function api_login(App &$a){
                // login with oauth
                try{
                        $oauth = new FKOAuth1();
         * @param App $a
         * @return string API call result
         */
-       function api_call(&$a){
-               GLOBAL $API, $called_api;
+       function api_call(App &$a){
+               global $API, $called_api;
 
                $type="json";
                if (strpos($a->query_string, ".xml")>0) $type="xml";
                        intval($gid),
                        dbesc($name));
                // error message if specified gid is not in database
-               if (count($rname) == 0)
+               if (!dbm::is_result($rname))
                        throw new BadRequestException('wrong group name');
 
                // delete group
                        intval($uid),
                        dbesc($name));
                // error message if specified group name already exists
-               if (count($rname) != 0)
+               if (dbm::is_result($rname))
                        throw new BadRequestException('group name already exists');
 
                // check if specified group name is a deleted group
                        intval($uid),
                        dbesc($name));
                // error message if specified group name already exists
-               if (count($rname) != 0)
+               if (dbm::is_result($rname))
                        $reactivate_group = true;
 
                // create group