ona  18.1.1
About: OpenNetAdmin provides a database managed inventory of your IP network (with Web and CLI interface).
  Fossies Dox: ona-18.1.1.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

login.php
Go to the documentation of this file.
1 <?php
2 /* -------------------- COMMON HEADER ---------------------- */
3 $base = dirname(__FILE__);
4 while ($base and (!is_dir($base.'/include'))) $base = preg_replace('+/[^/]*$+', '', $base);
5 $include = $base . '/include';
6 if (!is_dir($include)) { print "ERROR => Couldn't find include folder!\n"; exit; }
7 require_once($base . '/config/config.inc.php');
8 /* --------------------------------------------------------- */
9 // MP: Since we know ONA will generate a ton of notice level errors, lets turn them off here
10 // I dont believe this will be impactful to anyone. keep an eye out for it however.
11 error_reporting (E_ALL ^ E_NOTICE);
12 
13 // clear out existing session info
14 $_SESSION['ona']['auth'] = array();
15 
16 // enforce the HTTPS page if required
17 if (($_SERVER['SERVER_PORT'] != 443) and ($conf['force_https'] == 1)) {
18  echo <<<EOL
19 <html><body>
20 Redirecting you to: <a href="{$https}{$baseURL}/login.php">{$https}{$baseURL}/login.php</a>
21 <script type="text/javascript"><!--
22  setTimeout("window.location = \"{$https}{$baseURL}/login.php\";", 10);
23 --></script>
24 </body></html>
25 EOL;
26  exit;
27 }
28 
29 //
30 // Save a redirect url..
31 if (!isset($_SESSION['redirect']))
32  $_SESSION['redirect'] = (!empty($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : "{$https}{$baseURL}/";
33 
34 // Include xajax stuff (ajax calls will never make it past this line)
35 require_once($conf['inc_xajax_stuff']);
36 
37 $message = '';
38 if (!empty($_SESSION['login_failure'])) $message = $_SESSION['login_failure'];
39 unset($_SESSION['login_failure']);
40 
41 print <<<EOL
42 
43 <html>
44 <head>
45  <title>{$conf['title']} Standalone Login</title>
46  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
47  <link rel="stylesheet" type="text/css" href="{$baseURL}/include/html_style_sheet.inc.php">
48  <link rel="shortcut icon" type="image/ico" href="{$images}/favicon.ico">
49  <script type="text/javascript" src="{$baseURL}/include/js/global.js" language="javascript"></script>
50  {$conf['html_headers']}
51 </head>
52 <body>
53 <center>
54  <h1 style="color: #5262F2;">OpenNetAdmin Login</h1>
55  <div>
56  <form id="standalone_loginform_form" onSubmit="return(false);">
57  <input id="onapassword" type="hidden" name="onapassword">
58  <input id="standalone" type="hidden" name="standalone" value="standalone">
59  <table cellspacing="2" border="0" cellpadding="0">
60  <tr>
61  <td class="menu-item" align="right">
62  <img src="{$images}/silk/user.png" alt="Username" title="Username" align="left" border="0" style="display: inline;">
63  <input
64  id="onausername"
65  name="onausername"
66  class="edit"
67  style="width: 100px; font-size: 8pt;" type="text" maxlength="64" tabindex="1" accesskey="u"
68  onkeypress="if (event.keyCode == 13) { el('getpass').focus(); }"
69  >
70  </td>
71  </tr>
72  <tr>
73  <td class="menu-item" align="right">
74  <img src="{$images}/silk/key.png" alt="Password" title="Password" align="left" border="0" style="display: inline;">
75  <input
76  id="getpass"
77  name="getpass"
78  class="edit"
79  style="width: 100px; font-size: 8pt;" type="password" maxlength="64" tabindex="2" accesskey="p"
80  onkeypress="if (event.keyCode == 13) { el('loginbutton').click(); }"
81  >
82  </td>
83  </tr>
84  <tr>
85  <td class="menu-item" align="right">
86  <input id="loginbutton" class="button" style="font-size: smaller;" type="button" name="logon" value="Login"
87  onClick="el('onapassword').value = el('getpass').value;
88  xajax_window_submit('tooltips', xajax.getFormValues('standalone_loginform_form'), 'logingo');"
89  >
90  </td>
91  </tr>
92  </table>
93  </form>
94  </div>
95  <br>
96  <span style="color: red; font-weight: bold;" id="loginmsg">{$message}</span>
97 
98  <script type="text/javascript"><!--
99  /* Focus the username field */
100  el('onausername').focus();
101  //--></script>
102 
103  <br>
104 
105 </center>
106 </body>
107 </html>
108 
109 EOL;
110 
111 
112 
113 ?>
exit
exit
Definition: config.inc.php:186
$baseURL
$baseURL
Definition: config.inc.php:25
$include
$include
Definition: login.php:5
EOL
< a style="text-decoration: none;" href="/">< input class='edit' type="button" value="I don't like free stuff?" onclick=""/></a ></center ></div > EOL
Definition: install.php:40
$_SESSION
$_SESSION['ona']['auth']
Definition: login.php:14
$conf
global $conf
Definition: 2-to-3.php:15
$base
$base
Definition: login.php:3
$message
$message
Definition: login.php:37