2006-04-26 12:28:53 +00:00
< ? php
2009-09-08 05:29:38 +00:00
2006-04-26 12:28:53 +00:00
/*
----------------------------------------------------------------------
LICENSE
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License ( GPL )
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
To read the license please visit http :// www . gnu . org / copyleft / gpl . html
----------------------------------------------------------------------
*/
2017-10-11 09:58:04 +00:00
/**
* Show the login page ( hence the config_nochk below )
* this page is the only one , with logout . php , to NOT ask
* for authentication
*
* @ copyright AlternC - Team 2000 - 2017 https :// alternc . com /
*/
2006-04-26 12:28:53 +00:00
require_once ( " ../class/config_nochk.php " );
2017-08-17 01:32:18 +00:00
if ( $mem -> checkid ( false )) {
2016-03-03 12:45:11 +00:00
Header ( " Location: /main.php " );
exit ;
}
2017-08-17 01:32:18 +00:00
$mem -> del_session ();
2006-04-26 12:28:53 +00:00
$H = getenv ( " HTTP_HOST " );
2009-09-08 05:29:38 +00:00
if ( ! isset ( $restrictip )) {
$restrictip = 1 ;
}
2014-03-26 14:36:36 +00:00
if ( ! isset ( $charset ) || ! $charset ) $charset = " UTF-8 " ;
2011-06-05 08:15:32 +00:00
@ header ( " Content-Type: text/html; charset= $charset " );
2018-06-24 14:49:43 +00:00
require_once ( " html-head.php " );
2006-04-26 12:28:53 +00:00
?>
2016-02-26 09:17:05 +00:00
< body class = " login_page " >
2013-02-01 16:31:47 +00:00
< div id = " global " >
2016-02-26 09:17:05 +00:00
< div id = " content " >
2013-12-11 15:45:00 +00:00
< ? php
// Getting logo
2014-03-28 11:37:36 +00:00
$logo = variable_get ( 'logo_login' , '' , 'You can specify a logo for the login page, example /images/my_logo.png .' , array ( 'desc' => 'URL' , 'type' => 'string' ));
2013-12-11 15:45:00 +00:00
if ( empty ( $logo ) || ! $logo ) {
$logo = 'images/logo.png' ;
}
?>
2017-08-17 01:32:18 +00:00
< p id = 'logo' > < img src = " <?php echo $logo ; ?> " border = " 0 " height = " 100px " alt = " <?php __( " Web Hosting Control Panel " ); ?> " title = " <?php __( " Web Hosting Control Panel " ); ?> " />
2013-02-01 16:31:47 +00:00
</ p >
< p >& nbsp ; </ p >
2017-08-17 01:32:18 +00:00
< ? php echo $msg -> msg_html_all (); ?>
2013-02-01 16:31:47 +00:00
< br />
< ? php
if ( isset ( $_GET [ 'authip_token' ])) $authip_token = $_GET [ 'authip_token' ];
2014-06-17 20:57:26 +00:00
if ( variable_get ( 'https_warning' , true , 'warn users to switch to HTTPS' ) && ! isset ( $_SERVER [ 'HTTPS' ])) {
2016-02-26 09:17:05 +00:00
echo '<div class="unsecure"><strong>' . sprintf ( _ ( 'WARNING: you are trying to access the control panel insecurely, click <a href="https://%s">here</a> to go to secure mode' ), $_SERVER [ " HTTP_HOST " ]) . '</strong></div>' ;
2013-02-01 16:31:47 +00:00
}
?>
2016-02-26 09:17:05 +00:00
< div class = " block_list " >
< div class = " block_login_page " >
2013-02-01 16:31:47 +00:00
< ? php __ ( " To connect to the hosting control panel, enter your AlternC's login and password in the following form and click 'Enter' " ); ?>
2016-02-26 09:17:05 +00:00
</ div >
< div class = " block_login_page " >
< div class = " menu-box " >
2013-02-01 16:31:47 +00:00
< ? php if ( ! empty ( $authip_token )) { echo " <p style='color:red;'> " ; __ ( " You are attemping to connect without IP restriction. " ); echo " </p> " ; } ?>
2016-02-26 09:17:05 +00:00
< div class = " menu-title " >< ? php __ ( " AlternC access " ); ?> </div>
< form action = " login.php " method = " post " name = " loginform " target = " _top " >
2016-05-20 12:21:47 +00:00
< ? php csrf_get (); ?>
2016-02-26 09:17:05 +00:00
< div class = " menu-content " >
< div >< label for = " username " >< ? php echo _ ( " Username " ); ?> </label></td><td><input type="text" class="int" name="username" id="username" value="" maxlength="128" autocapitalize="none" /></div>
< div >< label for = " password " >< ? php echo _ ( " Password " ); ?> </label></td><td><input type="password" class="int" name="password" id="password" value="" maxlength="128" /></div>
2016-03-03 12:45:11 +00:00
< div class = " submit " >< input type = " submit " class = " inb " name = " submit " onclick = 'return logmein();' value = " <?php __( " Enter " ); ?> " />< input type = " hidden " id = " restrictip " name = " restrictip " value = " 0 " />
2016-05-22 18:14:26 +00:00
< input type = " hidden " id = " authip_token " name = " authip_token " value = " <?php ehe( (empty( $authip_token )?'': $authip_token ) ) ?> " /></ div >
2016-02-26 09:17:05 +00:00
</ div >
2013-02-01 16:31:47 +00:00
</ form >
2016-02-26 09:17:05 +00:00
</ div >
</ div >
< div class = " block_login_page " >
2013-02-01 16:31:47 +00:00
2016-02-26 09:17:05 +00:00
< ? php __ ( " You must accept the session cookie to log-in " ); ?>
< br />
< ? php echo _ ( " If you want to use a different language, choose it in the list below " ); ?>
< br />
< ? php
foreach ( $locales as $l ) {
?>
< a href = " ?setlang=<?php echo $l ; ?> " >< ? php if ( isset ( $lang_translation [ $l ])) echo $lang_translation [ $l ]; else echo $l ; ?> </a>
< ? php } ?>
< br />
< ? php
$mem -> show_help ( " login " , true );
?>
</ div >
< div class = " block_login_page " >
2013-02-01 16:31:47 +00:00
< ? php
// Here we used to have a form to enter the squirrelmail's webmail.
// Following the "rule of less astonishment, we try to put it here again, even though the webmail is now a plugin.
$res = $hooks -> invoke ( " hook_admin_webmail " );
if (( $wr = variable_get ( " webmail_redirect " )) && isset ( $res [ $wr ]) && $res [ $wr ]) {
$url = $res [ $wr ];
} else {
foreach ( $res as $r ) if ( $r !== false ) { $url = $r ; break ; }
}
if ( isset ( $url ) && $url ) {
?>
< 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>
< ? php
}
?>
2016-02-26 09:17:05 +00:00
</ div >
</ div >
< div class = " alternc_powered " >
2013-04-23 21:28:02 +00:00
< a href = " http://www.alternc.com/ " >< img src = " images/powered_by_alternc2.png " width = " 128 " height = " 32 " alt = " Powered by AlternC " /></ a >
2013-02-01 16:31:47 +00:00
</ div >
2016-02-26 09:17:05 +00:00
2013-04-19 07:18:25 +00:00
< script type = " text/javascript " >
2013-03-07 09:19:20 +00:00
$ ( '#username' ) . focus ();
2013-02-01 16:31:47 +00:00
function logmein (){
if ( $ ( '#username' ) . val () == '' || $ ( '#password' ) . val () == '' ) {
2013-03-07 09:19:20 +00:00
alert ( " <?php __( " Need a login and a password " ); ?> " );
2013-02-01 16:31:47 +00:00
return false ;
}
return true ;
}
</ script >
</ div >
2013-05-23 15:39:00 +00:00
< div style = " clear:both; " ></ div >
2013-04-19 07:18:25 +00:00
</ div >
2006-04-26 12:28:53 +00:00
</ body >
</ html >