Пример #1
0
function updateUser($sessionkey, $appcode, $Userdata)
{
    $main_result = "<VPROFILERESULT>";
    $main_result .= "<AUTHSTATUS>0</AUTHSTATUS>";
    $userId = ValidateSession($sessionkey, $appcode);
    if ($userId > -1) {
        $main_result = "<AUTHSTATUS>1</AUTHSTATUS>";
        $obj_User = new User();
        foreach ($Userdata["[UPPERTEMPLATENAME"] as $key => $child) {
            switch ($key) {
                case "USERID":
                    $obj_User->userId = $child;
                    break;
                case "USERNAME":
                    $obj_User->userName = $child;
                    break;
                case "PASSWORD":
                    $obj_User->password = $child;
                    break;
                case "PERSONID":
                    $obj_User->personId = $child;
                    break;
                case "USERTYPE":
                    $obj_User->userType = $child;
                    break;
                case "USEROPTCODE":
                    $obj_User->userOptCode = $child;
                    break;
                case "USERMETADATA":
                    $obj_User->userMetadata = $child;
                    break;
                case "USERSTATUS":
                    $obj_User->userStatus = $child;
                    break;
            }
        }
        $obj_retResult_User = DAL_manageUser::updateUser($obj_User);
        if ($obj_retResult_User->type == 1) {
            $main_result .= "<RESULTSTATUS>1</RESULTSTATUS>";
            $main_result .= getUserXml($obj_retResult_User->data);
        } else {
            $main_result .= "<RESULTSTATUS>0</RESULTSTATUS>";
        }
    }
    $main_result .= "</VPROFILERESULT>";
    return $main_result;
}
Пример #2
0
 public static function updateUser3($userId, $userName, $password, $personId, $userType)
 {
     $obj_retResult = new returnResult();
     $obj_newUser = new User();
     $obj_newUser->userId = $userId;
     $obj_newUser->userName = $userName;
     $obj_newUser->password = $password;
     $obj_newUser->personId = $personId;
     $obj_newUser->userType = $userType;
     $issuccess = DAL_manageUser::updateUser($obj_newUser);
     if ($issuccess) {
         $obj_retResult->type = 1;
         //	$obj_retResult->data = BL_manageUser::getUserByuserId($obj_newUser->userId);
         $obj_retResult->msg = "User updation is Success";
     } else {
         $obj_retResult->type = 0;
         $obj_retResult->msg = "User updation is Failed";
     }
     return $obj_retResult;
 }