public function modifyUser()
 {
     $username = $_POST['userName'];
     $userLastName = $_POST['userLastName'];
     $userPassword = $_POST['password'];
     $passwordAgain = $_POST['rePassword'];
     $userDao = new UserDao();
     $userInfoDao = new UserInfoDao();
     $uid = getUID();
     $user = $userDao->selectUserById($uid);
     $user->lastName = $userLastName;
     $user->password = $userPassword;
     $user->name = $username;
     User::readProperties($user, $_POST);
     $user->setInstitutionName($_POST['InstitutionName']);
     $userDao->updateUser($user, $uid);
     $userInfoDao->modifyUserInfo($id, $user);
 }
<?php

require_once '../Dao.Impl/UserInfoDao.php';
require_once '../model/UserInfo.php';
try {
    $json = file_get_contents('php://input');
    $obj = json_decode($json);
    $userInfoDao = new UserInfoDao();
    $userInfo = new UserInfo();
    $tag = $obj->{'tag'};
    if ($tag == 'register') {
        $first_name = $obj->{'first_name'};
        $last_name = $obj->{'last_name'};
        $password = $obj->{'password'};
        $email = $obj->{'email'};
        $mobile = $obj->{'mobile'};
        $user_check = $userInfoDao->isUserExisted($email);
        if ($user_check == TRUE) {
            $response[] = array('success' => '0', 'message' => 'User already exist.');
        } else {
            $userInfo->cus_firstname = (string) $first_name;
            $userInfo->cus_lastname = (string) $last_name;
            $userInfo->cus_mobile = (string) $mobile;
            $userInfo->cus_email = (string) $email;
            $userInfo->cus_password = (string) md5($password);
            $userInfo = $userInfoDao->Create($userInfo);
            $userInfo->success = 1;
            $response = array($userInfo);
        }
    } else {
        if ($tag == 'login') {