コード例 #1
0
 public function login()
 {
     if (UAuth::Auth_Login($_POST['username'], $_POST['password'])) {
         $this->redirect('/Dashboard/Index/index', array(), 2, '登录成功,页面跳转中...');
     } else {
         $this->error('Username or Password Incorrect,please try again', U('Home/Index/index'));
     }
 }
コード例 #2
0
 public function newproject()
 {
     if (UAuth::Check_LoginValid()) {
         layout('common_layout');
         $this->display();
     } else {
         $this->error('Login state changed,please try again', U('Home/Index/index'));
     }
 }
コード例 #3
0
 public function addNewProject()
 {
     $addProj = M('siteboard_project');
     $data['uid'] = session('uid');
     $data['pid'] = UAuth::random_str(50);
     $data['name'] = I('post.name');
     $data['type'] = I('post.type');
     $data['giturl'] = I('post.url');
     $data['folder'] = I('post.folder');
     $data['description'] = I('post.description');
     //        $data['']=I('post.');
     //        array_unshift($data,array(I('post.')));
     if ($addProj->data($data)->add()) {
         $this->success("Add Successfully", U('Dashboard/Index/index'));
     } else {
         $this->error("Fail");
     }
 }