30 lines
826 B
PHP
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
|
|
));
|
|
}
|
|
|
|
}
|