Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
loginform.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * PHP Authentification control
9  *
10  * @author Anakeen 1999
11  * @version $Id: loginform.php,v 1.17 2008/10/10 07:16:07 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage CORE
15  * @deprecated since HTTP Authentification
16  */
17 /**
18  */
19 include_once ('Class.Session.php');
20 include_once ('Class.User.php');
21 include_once ('Class.Domain.php');
22 include_once ('Class.QueryDb.php');
23 include_once ('Lib.Http.php');
24 /**
25  * PHP Authentification control
26  *
27  * @deprecated since HTTP Authentification
28  */
29 function loginform(&$action)
30 {
31  $action->parent->AddCssRef("AUTHENT:loginform.css", true);
32  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/resizeimg.js");
33  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/geometry.js");
34  $ulang = GetHttpVars("lang");
35  if ($ulang) {
36  setLanguage($ulang);
37  //$action->setparamu("CORE_LANG",$ulang);
38 
39  } else {
40  $ulang = getParam('CORE_LANG');
41  }
42  $action->lay->set("isEnglish", substr($ulang,0,2)=="en");
43  $error = GetHttpVars("error", 0);
44  $merr = "";
45  if ($error > 0) {
46  switch ($error) {
47  case 2:
48  $merr = _("Too many incorrect password attempts.") . _(" Please, see your manager");
49  break;
50 
51  case 3:
52  $merr = _("This account is deactivated.") . _(" Please, see your manager");
53  break;
54 
55  case 4:
56  $merr = _("This account has expired.") . _(" Please, see your manager");
57  break;
58 
59  default:
60  $merr = _("auth_failure");
61  }
62  }
63  $auth_user = GetHttpVars("auth_user");
64  $auth_pass = GetHttpVars("auth_pass");
65  $app_redir = GetHttpVars("appd", "CORE");
66  $act_redir = GetHttpVars("actd", "");
67  $arg_redir = GetHttpVars("argd", ""); // redirect url
68  $domain = GetHttpVars("domain");
69 
70  $action->lay->set("app_redir", $app_redir);
71  $action->lay->set("act_redir", $act_redir);
72  $action->lay->set("arg_redir", $arg_redir);
73  $action->lay->set("title", _("welcome"));
74  $action->lay->set("auth_user", $auth_user);
75  $action->lay->set("passfocus", ($auth_user !== "" ? true : false));
76  $action->lay->set("error", $merr);
77 
78  if ($action->getParam('AUTHENT_SHOW_REQPASSWD') == 'yes') {
79  $action->lay->set('AUTHENT_SHOW_REQPASSWD', True);
80  } else {
81  $action->lay->set('AUTHENT_SHOW_REQPASSWD', False);
82  }
83 
84  if ($action->getParam('AUTHENT_SHOW_LANG_SELECTION') == 'yes') {
85  $action->lay->set('AUTHENT_SHOW_LANG_SELECTION', True);
86  } else {
87  $action->lay->set('AUTHENT_SHOW_LANG_SELECTION', False);
88  }
89 
90  include_once ('CORE/lang.php');
91  $lang_block = array();
92 
93  foreach ($lang as $k => $v) {
94  $lang_block[$k]['LANG_VALUE'] = $k;
95  $lang_block[$k]['LANG_LABEL'] = $lang[$k]['label'];
96  $lang_block[$k]['LANG_IS_SELECTED'] = ($ulang == $k);
97  }
98  $action->lay->setBlockData('LANG', $lang_block);
99  $action->parent->short_name = sprintf(_("%s Authentification") , $action->getParam("CORE_CLIENT"));
100 }
101 ?>
← centre documentaire © anakeen - published under CC License - Dynacase