Exemplo n.º 1
0
 public function loginpost()
 {
     if ($_POST['author'] == 'queryphp' && md5($_POST['pwd']) == md5('123456')) {
         MY()->setLogin();
         redirect(url_for("guestbook/adminlist"), "登录成功", 3);
     }
     redirect(url_for("guestbook/login"), "登录失败", 3);
 }
Exemplo n.º 2
0
 function login()
 {
     MY()->isadmin = true;
     MY()->acl = array(2);
     MY()->session("acl", json_encode(array(2)));
     MY()->session("uid", 2);
     MY()->setLogin();
     MY()->session("acl", json_encode(array(2)));
 }
Exemplo n.º 3
0
 function login($a)
 {
     $user = M("user");
     $user->whereusernameANDpassword($a['username'], md5($a['password']))->limit(1)->fetch();
     echo $user->querySQL();
     if (!$user->isEmpty()) {
         MY()->setLogin();
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 4
0
 function index()
 {
     echo "hello world!";
     $array1 = array("a" => "green", "b" => "brown", "www" => array("aa" => "8888"), "c" => "blue", "red");
     $array2 = array("a" => "green", "yellow", "red");
     $result_array = array_intersect($array1, $array2);
     echo "<pre>";
     print_r($result_array);
     print_r(MY()->array_multi2single($array1));
     echo "</pre>";
     echo "<pre>";
     /*$this->assign("ssss","aa");
     	$this->hhh="88";
     	$this->pager=C("pager");
     	$this->pager->setPager(500,10,'page');
     	print_r($this->pager->getWholeBar(url_for("default/index/page/:page")));
     
     	echo("page:".$this->pager->offset().":");
     	$booktype=M("booktype");
         $booktype->limit($this->pager->offset(),10);
     	$booktype->getAll();
     	print_r($booktype->getRecord());
     	//echo C("zh2pinyin")->T("开源硬件能否像    开源软件一样流行");
     	//print_r($booktype->getAll());
     	C("waterimg")->createWaterPng("水印开始");
     	$img=C("img");
     	echo "</pre>";
     	//echo($img->safeName("开源硬件能否像    开源软件一样流行@#$%@#asdf=-_afasdf.jpg"));
     	
     	echo $booktype->fetch('FETCH_OBJ')->up()->bookid;
     	print_r($booktype->data);
     	echo $booktype->classname;
     	*/
     //   $booktype=M("booktype");
     //$booktype->selectSupply("address,title");
     //$booktype->selectbooktype("bookid,classname")->selectsupply("address,title")->leftjoin("supply")->joinon("supply.bookid=booktype.bookid")->where('bookid',404)->fetch();
     //  print_r($booktype->getObjRecord());
     //J("saybye",array("bbee"=>6666,"ccdd"=>888));
     return false;
 }
Exemplo n.º 5
0
 public function isMyUid($uid)
 {
     return MY()->UID() == $uid ? true : false;
 }