Esempio n. 1
0
 /**
  * Changes user RealName
  * 
  * @param array $changeParams
  * 
  * @return array
  */
 protected function changeUserRealName($changeParams)
 {
     $result = array();
     if (isset($changeParams['customerid'])) {
         if (isset($this->allUserData[$changeParams['customerid']])) {
             if (isset($changeParams['value'])) {
                 zb_UserChangeRealName($changeParams['customerid'], $changeParams['value']);
                 $result = array('result' => 'ok');
             } else {
                 $result = array('result' => 'error', 'error' => $this->errorNotices['EX_PARAM_MISSED'] . ': value');
             }
         } else {
             $result = array('result' => 'error', 'error' => $this->errorNotices['EX_USER_NOT_EXISTS'] . ': ' . $changeParams['customerid']);
         }
     } else {
         $result = array('result' => 'error', 'error' => $this->errorNotices['EX_PARAM_MISSED'] . ': customer_id');
     }
     return $result;
 }
Esempio n. 2
0
<?php

if (cfr('REALNAME')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change realname if need
        if (isset($_POST['newrealname'])) {
            $realname = $_POST['newrealname'];
            zb_UserChangeRealName($login, $realname);
            rcms_redirect("?module=realnameedit&username=" . $login);
        }
        $current_realname = zb_UserGetRealName($login);
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldnames = array('fieldname1' => __('Current Real Name'), 'fieldname2' => __('New Real Name'));
        $fieldkey = 'newrealname';
        $form = web_EditorStringDataForm($fieldnames, $fieldkey, $useraddress, $current_realname);
        $form .= web_UserControls($login);
        // show form
        show_window(__('Edit realname'), $form);
    }
} else {
    show_error(__('You cant control this module'));
}
Esempio n. 3
0
     } else {
         $currentContractDate = '';
     }
     if (empty($currentContractDate)) {
         zb_UserContractDateCreate($_POST['editcontract'], $newcontractdate);
     } else {
         zb_UserContractDateSet($_POST['editcontract'], $newcontractdate);
     }
 }
 //realname editing
 if (wf_CheckPost(array('editsurname', 'editname', 'editpatronymic'))) {
     $newsurname = $_POST['editsurname'];
     $newname = $_POST['editname'];
     $newpatronymic = $_POST['editpatronymic'];
     $normalRealName = $newsurname . ' ' . $newname . ' ' . $newpatronymic;
     zb_UserChangeRealName($login, $normalRealName);
 }
 //passportdata editing
 if (wf_CheckPost(array('editbirthdate'))) {
     $newbirthdate = $_POST['editbirthdate'];
     $newpassportnum = $_POST['editpassportnum'];
     $newpassportdate = $_POST['editpassportdate'];
     $newpassportwho = $_POST['editpassportwho'];
     //if address is not like primary
     if (!isset($_POST['custompaddress'])) {
         $newpcity = $_POST['editpcity'];
         $newpstreet = $_POST['editpstreet'];
         $newpbuild = $_POST['editpbuild'];
         $newpapt = $_POST['editpapt'];
     } else {
         //if paddress must be like primary