当前位置: 首页>>代码示例>>PHP>>正文


PHP FileData::LoadOrganizationFoID方法代码示例

本文整理汇总了PHP中FileData::LoadOrganizationFoID方法的典型用法代码示例。如果您正苦于以下问题:PHP FileData::LoadOrganizationFoID方法的具体用法?PHP FileData::LoadOrganizationFoID怎么用?PHP FileData::LoadOrganizationFoID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileData的用法示例。


在下文中一共展示了FileData::LoadOrganizationFoID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Login

 public function Login($name, $passwd)
 {
     $access = false;
     $data_org = new FileData();
     $l = fopen('system/log.dat', 'a+');
     $result = mysql_query("SELECT * FROM users WHERE login='{$name}'");
     if ($myuser = mysql_fetch_array($result)) {
         if (md5($passwd) == $myuser['passwdhash']) {
             $access = true;
             $this->name = $name;
             $this->organizationid = $myuser['orgnizid'];
             //echo'id='.$myuser['orgnizid'];
             $this->hashpasswd = md5($passwd);
             $this->id_user = $myuser['id'];
             $this->viewgroup = $myuser['viewgroup'];
             $this->viewname = $myuser['viewname'];
             $this->privilege = $myuser['privilege'];
             $orgname = $data_org->LoadOrganizationFoID($myuser['orgnizid']);
             //print_r($orgname);
             $this->organization = $orgname[0];
             $this->organizationlastname = $orgname[1];
             unset($_SESSION["login"]);
             unset($_SESSION["pwd"]);
             $_SESSION['login'] = $this->name;
             $_SESSION['pwd'] = $this->hashpasswd;
             //fwrite($l,"user:$name login Sucses \n"); //запись в лог файл
             $this->sendlog("user:{$name} login Sucses");
         }
     } elseif (!isset($_SESSION['login']) && !isset($_SESSION['pwd'])) {
         echo 'нет такого пользователя!!!';
         $this->sendlog("user:{$name} bad login");
     }
     if (isset($_SESSION['login']) && isset($_SESSION['pwd']) && !$access) {
         $result = mysql_query("SELECT * FROM users WHERE login='{$_SESSION['login']}'");
         $myuser = mysql_fetch_array($result);
         if ($myuser && $_SESSION['pwd'] == $myuser['passwdhash']) {
             $access = true;
             $this->name = $myuser['login'];
             $this->organizationid = $myuser['orgnizid'];
             $this->hashpasswd = $_SESSION['pwd'];
             $this->id_user = $myuser['id'];
             $this->viewgroup = $myuser['viewgroup'];
             $this->viewname = $myuser['viewname'];
             $this->email = $myuser['email'];
             $this->privilege = $myuser['privilege'];
             $orgname = $data_org->LoadOrganizationFoID($myuser['orgnizid']);
             $this->organization = $orgname[0];
             $this->organizationlastname = $orgname[1];
         }
     }
     if (!$access) {
         $this->sendlog("user: {$name} login failed");
         //	$t=date("Y-m-d H:i:s");
         //	fwrite($l,"$t user:$name login failed \n");
     }
     fclose($l);
     return $access;
 }
开发者ID:antbut,项目名称:my_site_php,代码行数:58,代码来源:user.php


注:本文中的FileData::LoadOrganizationFoID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。