public function __async_save()
    {
        // If form has been sent
        if (isset($_POST)) {

            // Create or find user depending on UserID passed
            /** @var \samson\activerecord\user $db_user */
            $db_user = null;
            if (!dbQuery('user')->UserID($_POST['UserID'])->Active(1)->first($db_user)) {
                $db_user = new \samson\activerecord\user(false);
            }
            // Save user data from form
            $db_user->Created 	    = ( $_POST['Created'] == 0 ) ? date('Y-m-d H:i:s') : $_POST['Created'];
            $db_user->FName 	    = $_POST['FName'];
            $db_user->SName 	    = $_POST['SName'];
            $db_user->TName 	    = $_POST['TName'];
            $db_user->Password  	= $_POST['Password'];
            $db_user->Email 	    = $_POST['Email'];
            $db_user->md5_password 	= md5($_POST['Password']);
            $db_user->md5_email 	= md5($_POST['Email']);
            $db_user->Active		= 1;
            $db_user->save();

            // Refresh session user object
            $auth_user_id = unserialize($_SESSION[m('socialemail')->identifier()]);
            if ($auth_user_id['UserID'] == $db_user['UserID']) {
                m('socialemail')->update($db_user);
            }
        }
        return array ('status' => 1);
    }
public function __async_save()
    {
        // If form has been sent
        if (isset($_POST)) {

            // Create or find user depending on UserID passed
            /** @var \samson\activerecord\user $db_user */
            $db_user = null;
            if (!dbQuery('user')->UserID($_POST['UserID'])->Active(1)->first($db_user)) {
                $db_user = new \samson\activerecord\user(false);
            }
            // Save user data from form
            $db_user->Created 	    = ( $_POST['Created'] == 0 ) ? date('Y-m-d H:i:s') : $_POST['Created'];
            $db_user->FName 	    = $_POST['FName'];
            $db_user->SName 	    = $_POST['SName'];
            $db_user->TName 	    = $_POST['TName'];
            $db_user->Password  	= $_POST['Password'];
            $db_user->Email 	    = $_POST['Email'];
            $db_user->md5_password 	= md5($_POST['Password']);
            $db_user->md5_email 	= md5($_POST['Email']);
            $db_user->Active		= 1;
            $db_user->save();

            // Refresh session user object
            $auth_user_id = unserialize($_SESSION[m('socialemail')->identifier()]);
            if ($auth_user_id['UserID'] == $db_user['UserID']) {
                m('socialemail')->update($db_user);
            }
        }
        return array ('status' => 1);
    }
public function __async_save ( ) { // If form has been sent if ( isset ( $ _POST ) ) { // Create or find user depending on UserID passed /** @var \samson\activerecord\user $db_user */ $ db_user = null ; if ( ! dbQuery ( 'user' ) -> UserID ( $ _POST [ 'UserID' ] ) -> Active ( 1 ) -> first ( $ db_user ) ) { $ db_user = new \ samson \ activerecord \ user ( false ) ; } // Save user data from form $ db_user -> Created = ( $ _POST [ 'Created' ] == 0 ) ? date ( 'Y-m-d H:i:s' ) : $ _POST [ 'Created' ] ; $ db_user -> FName = $ _POST [ 'FName' ] ; $ db_user -> SName = $ _POST [ 'SName' ] ; $ db_user -> TName = $ _POST [ 'TName' ] ; $ db_user -> Password = $ _POST [ 'Password' ] ; $ db_user -> Email = $ _POST [ 'Email' ] ; $ db_user -> md5_password = md5 ( $ _POST [ 'Password' ] ) ; $ db_user -> md5_email = md5 ( $ _POST [ 'Email' ] ) ; $ db_user -> Active = 1 ; $ db_user -> save ( ) ; // Refresh session user object $ auth_user_id = unserialize ( $ _SESSION [ m ( 'socialemail' ) -> identifier ( ) ] ) ; if ( $ auth_user_id [ 'UserID' ] == $ db_user [ 'UserID' ] ) { m ( 'socialemail' ) -> update ( $ db_user ) ; } } return array ( 'status' => 1 ) ; }
Save user data
Save user data