public function save() { $id = I('post.id','0','intval'); $name = I('post.name','','trim'); $folder = I('post.folder','','trim'); if(!$name || strlen($name)>20) { $this->out(null,1); } $where = array('name'=>$name); $row = $this->dao->getByName($name); if($row) { $this->out(null,13); } if(!$id) { if(!$folder || strlen($folder)>20) { $this->out(null,1); } $row = $this->dao->getByFolder($folder); if($row) { $this->out(null,13); } } parent::save(); }
function __construct() { parent::__construct(); $this->dao = M('apps'); $this->platform_type = C('PLATFORM_TYPE'); $this->assign('platform_type',$this->platform_type); }
public function index() { $this->assign('HOME_ON',' class="active"'); $this->assign('TITLE','应用管理 - '.$this->WEB_NAME); parent::index(); }
public function save() { $name = I('post.name','','trim'); $gid = I('post.gid',0,'intval'); $realname = I('post.realname','','trim'); $pwd1 = I('post.p1','','trim'); $pwd2 = I('post.p2','','trim'); if(!$name || strlen($name)>20 || !$gid || !$realname || strlen($realname)>20 || !$pwd1) { $this->error('请填写正确的参数'); } // if(!$this->checkSafePwd($pwd1)) // { // $this->error('您的密码不符合安全策略'); // } if($pwd1 != $pwd2) { $this->error('两次密码输入不一致'); } $_POST['pwd'] = _md5($pwd1); unset($_POST['pwd1'],$_POST['pwd2']); parent::save(); }