Example #1
0
/**
 * @brief Entrypoint for the OpenID implementation.
 *
 * @param App &$a
 */
function id_init(&$a)
{
    logger('id: ' . print_r($_REQUEST, true));
    if (argc() > 1) {
        $which = argv(1);
    } else {
        $a->error = 404;
        return;
    }
    $profile = '';
    $channel = $a->get_channel();
    profile_load($a, $which, $profile);
    $op = new MysqlProvider();
    $op->server();
}
Example #2
0
        $q = mysql_query("SELECT MAX(id) FROM Associations");
        $result = mysql_fetch_row($q);
        return $q[0] + 1;
    }
    function setAssoc($handle, $data)
    {
        $data = mysql_real_escape_string(serialize($data));
        mysql_query("REPLACE INTO Associations VALUES('{$handle}', '{$data}')");
    }
    function getAssoc($handle)
    {
        if (!is_numeric($handle)) {
            return false;
        }
        $q = mysql_query("SELECT data FROM Associations WHERE id = '{$handle}'");
        $data = mysql_fetch_row($q);
        if (!$data) {
            return false;
        }
        return unserialize($data[0]);
    }
    function delAssoc($handle)
    {
        if (!is_numeric($handle)) {
            return false;
        }
        mysql_query("DELETE FROM Associations WHERE id = '{$handle}'");
    }
}
$op = new MysqlProvider();
$op->server();