コード例 #1
0
 /**
  *	Option: Change Personal ID
  *	Change the PID from account
  *
  *	@return	void
  */
 public function ChangePersonalID()
 {
     $this->lang->setArguments("UserPanel,ChangePID,SecureQuestion", $this->userData['info']['fpas_ques']);
     if ($_GET['write'] == true) {
         if (empty($_POST['Password']) || empty($_POST['SecureAnswer']) || empty($_POST['SetNewPID'])) {
             return setResult(showMessage($this->lang->words['UserPanel']['ChangePID']['Messages']['Void'], 1));
         } elseif (!is_numeric($_POST['SetNewPID'])) {
             return setResult(showMessage($this->lang->words['UserPanel']['ChangePID']['Messages']['Error_Words'], 1));
         } elseif (strlen($_POST['SetNewPID']) != 7) {
             return setResult(showMessage($this->lang->words['UserPanel']['ChangePID']['Messages']['Error_Length'], 1));
         }
         $this->DB->Arguments(USER_ACCOUNT, $_POST['Password'], USE_MD5);
         $this->DB->Query("EXEC dbo.CTM_CheckAccount '%s','%s',%d", $checkPasswordQ);
         $checkPassword = $this->DB->FetchRow($checkPasswordQ);
         if ("0x" . bin2hex($checkPassword[0]) != "0x03") {
             setResult(showMessage($this->lang->words['UserPanel']['ChangePID']['Messages']['Error_Password'], 2));
         }
         if (strcmp(strtolower($_POST['SecureAnswer']), strtolower($this->userData['info']['fpas_answ'])) != 0) {
             setResult(showMessage($this->lang->words['UserPanel']['ChangePID']['Messages']['Error_Answer'], 2));
         }
         $this->MuLib('Member')->UpdateAccount(USER_ACCOUNT, array("info" => array("sno__numb" => $_POST['SetNewPID'])));
         $this->WriteLog(array("option" => "Change Personal ID"));
         Authentication::ReloadSession();
         return setResult(showMessage($this->lang->words['UserPanel']['ChangePID']['Messages']['Success'], 3));
     }
 }
コード例 #2
0
 /**
  *	Option: Buy VIP
  *	Buy VIP plan using Coin 1
  *
  *	@return	void
  */
 public function BuyVIP()
 {
     if (empty($_GET['vip'])) {
         return NULL;
     }
     if (!($_GET['vip'] >= 1 && $_GET['vip'] <= 5)) {
         exit(showMessage($this->lang->words['UserPanel']['BuyVIP']['Messages']['Error_Type'], 2));
     }
     if ($_GET['write'] == true) {
         if (!array_key_exists($_POST['Plan'], $this->settings['USERPANEL']['FINANCIAL']['BUY_VIP']['PLANS'][$_GET['vip']])) {
             exit(showMessage($this->lang->words['UserPanel']['BuyVIP']['Messages']['Error_Plan'], 2));
         }
         if ($this->userData['coin'][COIN_COLUMN_1] < ($price = $this->settings['USERPANEL']['FINANCIAL']['BUY_VIP']['PLANS'][$_GET['vip']][$_POST['Plan']])) {
             exit(showMessage($this->lang->words['UserPanel']['BuyVIP']['Messages']['Error_Balance'], 2));
         }
         if ($this->userData['vip'][VIP_COLUMN] > 0 && $this->userData['vip'][VIP_COLUMN] != $_GET['vip'] && !$_GET['changePlan']) {
             $this->lang->setArguments("UserPanel,BuyVIP,Messages,ChangePlan", constant("VIP_NAME_" . $this->userData['vip'][VIP_COLUMN]));
             exit("<script>confirmChangePlan('" . $this->lang->words['UserPanel']['BuyVIP']['Messages']['ChangePlan'] . "');</script>");
         }
         $level = $this->userData['vip'][VIP_COLUMN] > 0 ? $this->userData['vip'][VIP_COLUMN] : $_GET['vip'];
         $begin = strlen($this->userData['vip'][VIP_BEGIN]) < 10 ? time() : $this->userData['vip'][VIP_BEGIN];
         $time = $this->userData['vip'][VIP_TIME] + $_POST['Plan'];
         if ($_GET['changePlan'] == true && $_POST['vip'] != $this->userData['vip'][VIP_COLUMN]) {
             $time = $_POST['Plan'];
             $level = $_GET['vip'];
             if (strlen($this->userData['vip'][VIP_TIME]) == 10) {
                 $time = strtotime("+ " . $_POST['Plan'] . " days");
             }
         } else {
             if (strlen($this->userData['vip'][VIP_TIME]) == 10) {
                 $time = strtotime("+ " . $_POST['Plan'] . " days", $this->userData['vip'][VIP_TIME]);
             }
         }
         $time = strlen($time) == 10 ? $time : strtotime("+ " . $time . " days");
         $expiration = date("d/m/Y", $time);
         $type = constant("VIP_NAME_" . $level);
         $this->MuLib('Member')->UpdateAccount(USER_ACCOUNT, array("vip" => array(VIP_COLUMN => $level, VIP_BEGIN => $begin, VIP_TIME => $time), "coin" => array(COIN_COLUMN_1 => $this->userData['coin'][COIN_COLUMN_1] -= $price)));
         $this->WriteLog(array("option" => "Convert Coin", "data" => array("[General] VIP Type: " . $type, "[General] VIP Plan: " . $_POST['Plan'] . " days", "[Before] Account Level: " . $this->functions->AccountLevel($this->userData['vip'][VIP_COLUMN]), "[Before] " . COIN_NAME_1 . ": " . number_format($this->userData['coin'][COIN_COLUMN_1], 0, false, "."), "[After] Account Level: " . $type, "[After] " . COIN_NAME_1 . ": " . number_format($this->userData['coin'][COIN_COLUMN_1] - $price, 0, false, "."), "[After] Expiration: " . $expiration)));
         Authentication::ReloadSession();
         $this->lang->setArguments("UserPanel,BuyVIP,Messages,Success", $type, $expiration);
         echo showMessage($this->lang->words['UserPanel']['BuyVIP']['Messages']['Success'], 3);
         exit("<script>completeBuyVIP('{$type}', '{$expiration}', '" . number_format($this->userData['coin'][COIN_COLUMN_1], 0, false, ".") . "');</script>");
     }
     $GLOBALS['userpanel']['buy_vip']['plans'] = $this->settings['USERPANEL']['FINANCIAL']['BUY_VIP']['PLANS'][$_GET['vip']];
     $GLOBALS['userpanel']['buy_vip']['current_coin_balance'] = number_format($this->userData['coin'][COIN_COLUMN_1], 0, false, ".");
     $GLOBALS['userpanel']['buy_vip']['current_account_level'] = $this->functions->AccountLevel($this->userData['vip'][VIP_COLUMN]);
     $GLOBALS['userpanel']['buy_vip']['current_account_expiration'] = $this->functions->MakeVIPTime($this->userData['vip'][VIP_TIME]);
     $GLOBALS['userpanel']['buy_vip']['current_type_selected'] = $this->functions->AccountLevel($_GET['vip']);
     $GLOBALS['userpanel']['buy_vip']['current_type_selected_id'] = $_GET['vip'];
 }