Exemplo n.º 1
0
function CCLoginUser($Login, $Password)
{
    $db = new clsDBDBNetConnect();
    $SQL = "SELECT `admin_id`, `level` FROM `administrators` WHERE `username`=" . $db->ToSQL($Login, ccsText) . " AND `password`=" . $db->ToSQL($Password, ccsText);
    $db->query($SQL);
    $Result = $db->next_record();
    if ($Result) {
        CCSetSession("AdminID", $db->f("admin_id"));
        CCSetSession("AdminLogin", $Login);
        CCSetSession("UserPassword", $Password);
        CCSetSession("AdminGroup", $db->f("level"));
    }
    unset($db);
    return $Result;
}