Exemplo n.º 1
0
                $ret = "1";
            } else {
                //register
                $ret = "0";
            }
            echo $ret;
        }
    } else {
        if ($_REQUEST['action'] == "checkusername") {
            $username = $_REQUEST["username"];
            if ($discuz_plugin->IsUsernameAvailable($username)) {
                echo "1";
            } else {
                echo "0";
            }
        } else {
            if ($_REQUEST['action'] == "checkprofile") {
                $profile = getGFCProfile($fcauth);
                if (!$profile) {
                    echo "ERROR : can not get GFC Profile";
                }
                $change = array();
                if ($discuz_plugin->CheckProfile($profile, $change) > 0) {
                    echo "1";
                } else {
                    echo "0";
                }
            }
        }
    }
}
Exemplo n.º 2
0
$discuz_plugin = new GFCPluginDiscuz($discuz_env, $gfcconfig);
$profile = getGFCProfile($fcauth);
if (!$profile) {
    echo "ERROR";
}
if ($_REQUEST['action'] == "update") {
    $update_level = 0;
    if ($_REQUEST['profilethumbnail'] == "1") {
        $update_level = $update_level | 1;
    }
    if ($_REQUEST['profilebio'] == "1") {
        $update_level = $update_level | 2;
    }
    if ($_REQUEST['profileurl'] == "1") {
        $update_level = $update_level | 4;
    }
    $uid = $discuz_uid;
    $discuz_plugin->SyncUserProfile($profile, $uid, $update_level);
    echo "1";
} else {
    if ($_REQUEST['action'] == "ajaxupdate") {
        $uid = $discuz_uid;
        $discuz_plugin->SyncUserProfile($profile, $uid, 1 | 2 | 4);
        echo "1";
    } else {
        $change = array();
        $profilestatus = $discuz_plugin->CheckProfile($profile, $change);
        extract($change);
        include template('gfcprofile');
    }
}