src/snac/server/database/SQL.php
/**
     * Revoke User Key
     *
     * Deletes the key in the database associtated with the given user id and label.
     *
     * @param int $appUserID The numeric ID for the user
     * @param string $label The label for the key
     *
     * @return boolean True if successfully removed, false otherwise
     */
Revoke User Key
Deletes the key in the database associtated with the given user id and label.

@param int $appUserID The numeric ID for the user
@param string $label The label for the key

@return boolean True if successfully removed, false otherwise
Revoke User Key Deletes the key in the database associtated with the given user id and label . @param int $appUserID The numeric ID for the user @param string $label The label for the key @return boolean True if successfully removed false otherwise
public function revokeUserKey($appUserID, $label)
    {
        $result = $this->sdb->query("select id from api_keys where uid=$1 and label=$2;", [$appUserID, $label]);
        $all = array();
        while($row = $this->sdb->fetchrow($result))
        {
            $all = $row;
        }
        if (!empty($all) && isset($all["id"])) {
            $result = $this->sdb->query("delete from api_keys where id=$1 returning *;", [$all["id"]]);
            $check = array();
            while($row = $this->sdb->fetchrow($result))
            {
                $check = $row;
            }
                        if (empty($all))
                return false;
            return true;
        }
        return false;
    }
public function revokeUserKey ( $ appUserID , $ label ) { $ result = $ this -> sdb -> query ( " select id from api_keys where uid=$1 and label=$2; " , [ $ appUserID , $ label ] ) ; $ all = array ( ) ; while ( $ row = $ this -> sdb -> fetchrow ( $ result ) ) { $ all = $ row ; } if ( ! empty ( $ all ) && isset ( $ all [ " id " ] ) ) { $ result = $ this -> sdb -> query ( " delete from api_keys where id=$1 returning *; " , [ $ all [ " id " ] ] ) ; $ check = array ( ) ; while ( $ row = $ this -> sdb -> fetchrow ( $ result ) ) { $ check = $ row ; } if ( empty ( $ all ) ) return false ; return true ; } return false ; }
Revoke User Key
 Deletes the key in the database associtated with the given user id and label.
Revoke User Key Deletes the key in the database associtated with the given user id and label .
// Check to see if the key exists for the user first // Return only the data returned (one row); // If key exists for the user, then delete it // Return only the data returned (one row); // Sanity check: did we actually delete something?
