File indexing completed on 2024-11-24 05:19:14
0001 <?php 0002 class LoginModel extends EModel { 0003 0004 public function login($nick, $pass){ 0005 $postdata = array( 0006 "login" => $login, 0007 "password" => $password 0008 ); 0009 $client = new OCSClient(EConfig::$data["ocs"]["host"]); 0010 $check = $client->post("v1/person/check",$postdata); 0011 //ELog::pd($client->get_last_raw_result()); 0012 if($check["ocs"]["meta"]["statuscode"]=="100"){ 0013 EUser::login($login,$password); 0014 return true; 0015 } else { 0016 return false; //TODO: provide an error message 0017 } 0018 } 0019 }