game2006api/webapp/controller/ActivationCodeController.class.php
hujiabin d67479e07b 1
2024-08-29 10:42:36 +08:00

30 lines
826 B
PHP

<?php
require_once('models/ActivationCode.php');
use models\ActivationCode;
use phpcommon\SqlHelper;
class ActivationCodeController extends BaseAuthedController {
public function bindActivationCode(){
$code = getReqVal('code', 0);
if (!ActivationCode::verifyCode($code)){
$this->_rspErr(1, "activation code error");
return;
}
if (ActivationCode::verifyAccountBind()){
$this->_rspErr(1, "The activation code has been bind");
return;
}
ActivationCode::addBindCode($code);
$this->_rspOk();
}
public function getActivationCodeBindState(){
$state = ActivationCode::verifyAccountBind() ? 1 :0;
$this->_rspData(array(
'state' => $state
));
}
}