Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
index.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2000-2012 by the AlternC Development Team.
7  https://alternc.org/
8  ----------------------------------------------------------------------
9  LICENSE
10 
11  This program is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License (GPL)
13  as published by the Free Software Foundation; either version 2
14  of the License, or (at your option) any later version.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  To read the license please visit http://www.gnu.org/copyleft/gpl.html
22  ----------------------------------------------------------------------
23  Purpose of file: Main index : show the login page
24  ----------------------------------------------------------------------
25 */
26 
27 require_once("../class/config_nochk.php");
28 
29 if (!$mem->del_session()) {
30  // No need to draw an error message ...
31  //$error=$err->errstr();
32 }
33 
34 $H=getenv("HTTP_HOST");
35 
36 if (!isset($restrictip)) {
37  $restrictip=1;
38 }
39 if (!$charset) $charset="UTF-8";
40 @header("Content-Type: text/html; charset=$charset");
41 
42 ?>
43 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
44 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
45 <head>
46 <title>AlternC Desktop</title>
47 <link rel="stylesheet" href="styles/style.css" type="text/css" />
48 <?php
49 if (file_exists("styles/style-custom.css") ) {
50  echo '<link rel="stylesheet" href="styles/style-custom.css" type="text/css" />';
51 }
52 ?>
53 
54 <script type="text/javascript" src="js/alternc.js"></script>
55 <script src="js/jquery.min_embedded.js" type="text/javascript"></script>
56 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
57 </head>
58 <body>
59  <div id="global">
60 
61  <div id="content" style="width:1000px;">
62 <?php
63 // Getting logo
64 $logo = variable_get('logo_login', '' ,'You can specify a logo for the login page, example /images/my_logo.png .', array(array('desc'=>'URL','type'=>'string')));
65 if ( empty($logo) || ! $logo ) {
66  $logo = 'images/logo.png';
67 }
68 ?>
69 
70  <p id="logo"> <img src="<?php echo $logo; ?>" border="0" alt="<?php __("Web Hosting Control Panel"); ?>" title="<?php __("Web Hosting Control Panel"); ?>" />
71  </p>
72  <p>&nbsp;</p>
73  <?php if (isset($error) && $error) echo "<div class='alert alert-danger'>$error</div>"; ?>
74  <br/>
75  <?php
76  if (isset($_GET['authip_token'])) $authip_token=$_GET['authip_token'];
77  /*
78  if (!$_SERVER[HTTPS]) {
79  echo "<h4>ATTENTION : vous allez acc�der � votre panel en mode *non s�curis�*<br/>
80  <a href=\"https://".$_SERVER["HTTP_HOST"]."/\">Cliquez ici pour passer en mode s�curis�</a></h4>";
81  }
82  */
83  ?>
84  <div style="margin: 0 auto 30px auto; width: 700px;">
85  <table width="100%"><tr><td>
86  <?php __("To connect to the hosting control panel, enter your AlternC's login and password in the following form and click 'Enter'"); ?>
87  <?php if (!empty($authip_token)) { echo "<p style='color:red;'>";__("You are attemping to connect without IP restriction."); echo "</p>"; } ?>
88  </td><td>
89  <form action="login.php" method="post" name="loginform" target="_top">
90  <table border="0" style="border: 1px solid #202020;" cellspacing="0" cellpadding="3" width="300px" >
91  <tr><td colspan="2" align="center"><b><?php __("AlternC access"); ?></b></td></tr>
92  <tr><td align="right"><label for="username"><?php echo _("Username"); ?></label></td><td><input type="text" class="int" name="username" id="username" value="" maxlength="128" size="15" /></td></tr>
93  <tr><td align="right"><label for="password"><?php echo _("Password"); ?></label></td><td><input type="password" class="int" name="password" id="password" value="" maxlength="128" size="15" /></td></tr>
94  <tr><td colspan="2" align="center"><input type="submit" class="inb" name="submit" onclick='return logmein();' value="<?php __("Enter"); ?>" /><input type="hidden" id="restrictip" name="restrictip" value="1" /></td></tr>
95  </table>
96  <input type="hidden" id="authip_token" name="authip_token" value="<?php echo htmlentities( (empty($authip_token)?'':$authip_token) ) ?>" />
97  </form>
98 
99  </td></tr>
100  <tr><td>
101 
102  <?php
103 
104  // Here we used to have a form to enter the squirrelmail's webmail.
105  // Following the "rule of less astonishment, we try to put it here again, even though the webmail is now a plugin.
106  $res=$hooks->invoke("hook_admin_webmail");
107  if (($wr=variable_get("webmail_redirect")) && isset($res[$wr]) && $res[$wr]) {
108  $url=$res[$wr];
109  } else {
110  foreach($res as $r) if ($r!==false) { $url=$r; break; }
111  }
112  if (isset($url) && $url) {
113  ?>
114  <p><a href="<?php echo $url; ?>"><?php __("To read your mail in a browser, click here to go to your server's Webmail"); ?></a></p>
115  <?php
116  }
117  ?></td><td>
118 
119  </td></tr>
120 
121  </table>
122 
123 
124  <table width="100%" style="border: 0">
125  <tr><td style="text-align: left; font-size: 10px">
126  <?php __("You must accept the session cookie to log-in"); ?>
127  <br />
128  <?php echo "If you want to use a different language, choose it in the list below"; ?>
129  <br />
130  <?php
131  foreach($locales as $l) {
132  ?>
133  <a href="?setlang=<?php echo $l; ?>"><?php if (isset($lang_translation[$l])) echo $lang_translation[$l]; else echo $l; ?></a>
134  <?php } ?>
135  <br />
136  <?php
137  $mem->show_help("login",true);
138  ?>
139  </td>
140  <td>
141  <p>
142  <a href="http://www.alternc.com/"><img src="images/powered_by_alternc2.png" width="128" height="32" alt="Powered by AlternC" /></a>
143  </p>
144  </td>
145  </tr>
146  </table>
147 
148 
149  </div>
150  <script type="text/javascript">
151  $('#username').focus();
152 
153  function logmein(){
154  if ( $('#username').val() =='' || $('#password').val() =='' ) {
155  alert("<?php __("Need a login and a password"); ?>");
156  return false;
157  }
158  return true;
159  }
160  </script>
161 
162  </div>
163  <div style="clear:both;" ></div>
164  </div>
165 </body>
166 </html>