Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * ForgotPasswordForm class file. * @author Christoffer Niska <christoffer.nisk..
Decoded Output download
<?php
/**
* ForgotPasswordForm class file.
* @author Christoffer Niska <[email protected]>
* @copyright Copyright © Nord Software Ltd 2014-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package nordsoftware.yii_account.form.models
*/
namespace nordsoftware\yii_account\modelsorm;
use nordsoftware\yii_account\helpers\Helper;
use nordsoftware\yii_account\Module;
class ForgotPasswordForm extends \CFormModel
{
/**
* @var string
*/
public $email;
/**
* @inheritDoc
*/
public function rules()
{
return array(
array('email', 'required'),
array('email', 'email'),
array('email', 'validateAccountExists'),
);
}
/**
* @inheritDoc
*/
public function attributeLabels()
{
return array(
'email' => Helper::t('labels', 'Email'),
);
}
public function validateAccountExists($attribute, $params)
{
if (($model = $this->loadModel($this->email)) === null) {
$this->addError($attribute, Helper::t('errors', 'Account not found.'));
}
}
/**
* @param string $email
* @return
ordsoftware\yii_account\modelsr\Account
* @throws
ordsoftware\yii_account\exceptions\Exception
*/
public function loadModel($email)
{
$modelClass = Helper::getModule()->getClassName(Module::CLASS_ACCOUNT);
return \CActiveRecord::model($modelClass)->findByAttributes(array('email' => $email));
}
} ?>
Did this file decode correctly?
Original Code
<?php
/**
* ForgotPasswordForm class file.
* @author Christoffer Niska <[email protected]>
* @copyright Copyright © Nord Software Ltd 2014-
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package nordsoftware.yii_account.form.models
*/
namespace nordsoftware\yii_account\models\form;
use nordsoftware\yii_account\helpers\Helper;
use nordsoftware\yii_account\Module;
class ForgotPasswordForm extends \CFormModel
{
/**
* @var string
*/
public $email;
/**
* @inheritDoc
*/
public function rules()
{
return array(
array('email', 'required'),
array('email', 'email'),
array('email', 'validateAccountExists'),
);
}
/**
* @inheritDoc
*/
public function attributeLabels()
{
return array(
'email' => Helper::t('labels', 'Email'),
);
}
public function validateAccountExists($attribute, $params)
{
if (($model = $this->loadModel($this->email)) === null) {
$this->addError($attribute, Helper::t('errors', 'Account not found.'));
}
}
/**
* @param string $email
* @return \nordsoftware\yii_account\models\ar\Account
* @throws \nordsoftware\yii_account\exceptions\Exception
*/
public function loadModel($email)
{
$modelClass = Helper::getModule()->getClassName(Module::CLASS_ACCOUNT);
return \CActiveRecord::model($modelClass)->findByAttributes(array('email' => $email));
}
}
Function Calls
None |
Stats
MD5 | c9021d3bf1aa7e77adea82a3464ea5e0 |
Eval Count | 0 |
Decode Time | 102 ms |