Ejemplo n.º 1
0
<?php

if (cfr('NOTES')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change notes if need
        if (isset($_POST['newnotes'])) {
            $notes = $_POST['newnotes'];
            zb_UserDeleteNotes($login);
            zb_UserCreateNotes($login, $notes);
            rcms_redirect("?module=notesedit&username=" . $login);
        }
        $current_notes = zb_UserGetnotes($login);
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldnames = array('fieldname1' => __('Current notes'), 'fieldname2' => __('New notes'));
        $fieldkey = 'newnotes';
        $form = web_EditorStringDataForm($fieldnames, $fieldkey, $useraddress, $current_notes);
        show_window(__('Edit notes'), $form);
        //additional notes
        $altCfg = $ubillingConfig->getAlter();
        if ($altCfg['ADCOMMENTS_ENABLED']) {
            $adcomments = new ADcomments('USERNOTES');
            show_window(__('Additional comments'), $adcomments->renderComments($login));
        }
        //user controls here
        show_window('', web_UserControls($login));
    }
} else {
    show_error(__('You cant control this module'));
}
Ejemplo n.º 2
0
 /**
  * Changes user notes
  * 
  * @param array $changeParams
  * 
  * @return array
  */
 protected function changeUserNotes($changeParams)
 {
     $result = array();
     if (isset($changeParams['customerid'])) {
         if (isset($this->allUserData[$changeParams['customerid']])) {
             if (isset($changeParams['value'])) {
                 zb_UserDeleteNotes($changeParams['customerid']);
                 zb_UserCreateNotes($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;
 }
Ejemplo n.º 3
0
     zb_UserCreateRealName($login, $user['realname']);
     zb_UserCreatePhone($login, $user['phone'], $user['mobile']);
     zb_UserCreateContract($login, $user['contract']);
     zb_UserCreateEmail($login, $user['email']);
     zb_UserCreateSpeedOverride($login, 0);
     multinet_change_mac($ip, $user['mac']);
     multinet_rebuild_all_handlers();
     $billing->setao($login, $user['ao']);
     $dstat = 1;
     $billing->setdstat($login, $dstat);
     $billing->setdown($login, $user['down']);
     $billing->setpassive($login, $user['passive']);
     $billing->settariff($login, $user['tariff']);
     $billing->setcredit($login, $user['credit']);
     $billing->setcash($login, $user['cash']);
     zb_UserCreateNotes($login, $user['address']);
 }
 if ($iopts['regtype'] == 'SQL') {
     $querybuff .= "\n            INSERT INTO `users` (\n            `login`,\n            `Password`,\n            `Passive`,\n            `Down`,\n            `DisabledDetailStat`,\n            `AlwaysOnline`,\n            `Tariff`,\n            `Address`,\n            `Phone`,\n            `Email`,\n            `Note`,\n            `RealName`,\n            `StgGroup`,\n            `Credit`,\n            `TariffChange`,\n            `Userdata0`,\n            `Userdata1`,\n            `Userdata2`,\n            `Userdata3`,\n            `Userdata4`,\n            `Userdata5`,\n            `Userdata6`,\n            `Userdata7`,\n            `Userdata8`,\n            `Userdata9`,\n            `CreditExpire`,\n            `IP`,\n            `D0`,\n            `U0`,\n            `D1`,\n            `U1`,\n            `D2`,\n            `U2`,\n            `D3`,\n            `U3`,\n            `D4`,\n            `U4`,\n            `D5`,\n            `U5`, \n            `D6`, \n            `U6`,\n            `D7`, \n            `U7`, \n            `D8`,\n            `U8`,\n            `D9`,\n            `U9`,\n            `Cash`,\n            `FreeMb`,\n            `LastCashAdd`,\n            `LastCashAddTime`,\n            `PassiveTime`,\n            `LastActivityTime`,\n            `NAS`)\n            VALUES (\n            '" . $login . "',\n            '" . $password . "',\n            '" . $user['passive'] . "',\n            '" . $user['down'] . "',\n            '1',\n            '" . $user['ao'] . "',\n            '" . $user['tariff'] . "',\n            '',\n            '',\n            '',\n            '',\n            '',\n            '',\n            '" . $user['credit'] . "',\n            '', \n            '',\n            '',\n            '',\n            '', \n            '', \n            '', \n            '', \n            '',\n            '', \n            '', \n            '" . $user['creditex'] . "',\n            '" . $ip . "',\n            '0',\n            '0',\n            '0',\n            '0',\n            '0', \n            '0',\n            '0',\n            '0', \n            '0',\n            '0',\n            '0',\n            '0',\n            '0', \n            '0',\n            '0',\n            '0', \n            '0', \n            '0', \n            '0', \n            '0', \n            '" . $user['cash'] . "',\n            '0',\n            '0', \n            '0',\n            '0', \n            '0',\n            '');\n            " . "\n";
     //multinet
     $querybuff .= "INSERT INTO `nethosts` (`id`,`netid`,`ip`,`mac`,`option`)  VALUES ('', '" . $netid . "' ,'" . $ip . "', '" . $user['mac'] . "', '');" . "\n";
     //realname
     $querybuff .= "INSERT INTO `realname` (`id`,`login`,`realname`)  VALUES (NULL, '" . $login . "','" . $user['realname'] . "');" . "\n";
     //phone & mobile
     $querybuff .= "INSERT INTO `phones` (`id`,`login`,`phone`,`mobile`)  VALUES (NULL, '" . $login . "','" . $user['phone'] . "','" . $user['mobile'] . "');" . "\n";
     //contract
     $querybuff .= "INSERT INTO `contracts` (`id`,`login`,`contract`)  VALUES (NULL, '" . $login . "','" . $user['contract'] . "');" . "\n";
     //email
     $querybuff .= "INSERT INTO `emails` (`id`,`login`,`email`)  VALUES (NULL, '" . $login . "','" . $user['email'] . "');" . "\n";
     //speedoverride
     $querybuff .= "INSERT INTO `userspeeds` (`id`,`login`,`speed`)  VALUES (NULL, '" . $login . "','0');" . "\n";
Ejemplo n.º 4
0
 $newuser_data['floor'] = $newfloor;
 $newuser_data['apt'] = $newaptnum;
 $newuser_data['service'] = $newserviceid;
 $newuser_data['IP'] = $newip;
 $newuser_data['login'] = $newlogin;
 $newuser_data['password'] = $newpassword;
 //register user in stargazer
 log_register("EXPRESSUSERREG(" . $newlogin . ") BEGIN");
 zb_UserRegister($newuser_data, false);
 //update misc data
 zb_UserChangeRealName($newlogin, $normalRealName);
 zb_UserChangeEmail($newlogin, $newemail);
 zb_UserChangePhone($newlogin, $newphone);
 zb_UserChangeMobile($newlogin, $newmobile);
 zb_UserDeleteNotes($newlogin);
 zb_UserCreateNotes($newlogin, $newnotes);
 zb_UserChangeContract($newlogin, $newcontract);
 zb_UserContractDateCreate($newcontract, $newcontractdate);
 zb_UserPassportDataCreate($newlogin, $newbirthdate, $newpassportnum, $newpassportdate, $newpassportwho, $newpcity, $newpstreet, $newpbuild, $newpapt);
 $billing->settariff($newlogin, $newtariff);
 log_register('CHANGE Tariff (' . $newlogin . ') ON ' . $newtariff);
 multinet_change_mac($newip, $newmac);
 log_register("MAC CHANGE (" . $newlogin . ") " . $newip . " ON " . $newmac);
 multinet_rebuild_all_handlers();
 //finally reset user
 $billing->resetuser($newlogin);
 log_register("RESET User (" . $newlogin . ")");
 log_register("EXPRESSUSERREG (" . $newlogin . ") END");
 rcms_redirect("?module=userprofile&username=" . $newlogin);
 /*
  * End of express userreg subroutine