Esempio n. 1
0
if (isAppLoggedIn()) {
    if ($action == 'delete') {
        // We've been requested to delete the account
        // Delete account
        if (!$ulogin->DeleteUser($_SESSION['uid'])) {
            $msg = 'account deletion failure';
        } else {
            $msg = 'account deleted ok';
        }
        // Logout
        appLogout();
    } else {
        if ($action == 'logout') {
            // We've been requested to log out
            // Logout
            appLogout();
            $msg = 'logged out';
        }
    }
} else {
    // We've been requested to log in
    if ($action == 'login') {
        // Here we verify the nonce, so that only users can try to log in
        // to whom we've actually shown a login page. The first parameter
        // of Nonce::Verify needs to correspond to the parameter that we
        // used to create the nonce, but otherwise it can be anything
        // as long as they match.
        if (isset($_POST['nonce']) && ulNonce::Verify('login', $_POST['nonce'])) {
            // We store it in the session if the user wants to be remembered. This is because
            // some auth backends redirect the user and we will need it after the user
            // arrives back.
Esempio n. 2
0
    $parentelement = "";
}
if ($_REQUEST['userid']) {
    $userFbId = $_REQUEST['userid'];
} else {
    $userFbId = 0;
}
switch ($task) {
    case 'appRegistration':
        appRegistration($name, $username, $email, $password, $date, $userFbId);
        break;
    case 'appLogin':
        appLogin($username, $password);
        break;
    case 'applogout':
        appLogout($loginid);
        break;
    case 'appConnectionFb':
        appConnectionFb($name, $username, $email, $password, $date, $userFbId);
        break;
    case 'timelineContent':
        timelineContent();
        break;
    case 'profileContent':
        profileContent($loginid);
        break;
    case 'profileCover':
        profileCover($loginid);
        break;
    case 'profileeditContent':
        profileeditContent($loginid);