Exemple #1
0
   Date: October 27,2010
   purpose: added login via password 

   Allowable operations - getuserinfo & login
   both return a full goUserSettings xml if successful
*/
$userID = $_REQUEST['userid'];
$userName = $_REQUEST['username'];
$operation = strtolower($_REQUEST['operation']);
if (empty($operation)) {
    $operation = 'getuserinfo';
}
if ($operation == 'login') {
    $password = $_REQUEST['password'];
    $params['password'] = $_REQUEST['password'];
    $userID = goUserSettings::login($userName, $password);
    if ($userID <= 0) {
        $userSettings = new goUserSettings();
        $userSettings->setOutputFlag('xml');
        header("Content-Type: text/xml");
        $userSettings->setStatusMessage("Not authorized");
        $userSettings->setStatusCode("403");
        echo $userSettings;
        ob_flush();
        exit;
    }
}
//if
$params = array();
$params['operation'] = $operation;
if (!empty($userID)) {