2006-04-26 12:28:53 +00:00
< ? php
/*
----------------------------------------------------------------------
AlternC - Web Hosting System
2012-09-04 13:51:53 +00:00
Copyright ( C ) 2000 - 2012 by the AlternC Development Team .
https :// alternc . org /
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
----------------------------------------------------------------------
2012-09-04 13:51:53 +00:00
Purpose of file : Main page shown after login , display misc information
2006-04-26 12:28:53 +00:00
----------------------------------------------------------------------
*/
require_once ( " ../class/config.php " );
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
2008-04-10 18:05:51 +00:00
2009-09-08 05:29:38 +00:00
// Show last login information :
echo " <p> " ;
2006-04-26 12:28:53 +00:00
__ ( " Last Login: " );
2012-08-25 10:03:29 +00:00
if ( $mem -> user [ " lastlogin " ] == " 0000-00-00 00:00:00 " ) {
__ ( " Never " );
} else {
2012-11-07 13:24:28 +00:00
echo format_date ( _ ( 'the %3$d-%2$d-%1$d at %4$d:%5$02d' ), $mem -> user [ " lastlogin " ]);
2012-08-25 10:03:29 +00:00
printf ( " " . _ ( 'from: <code> %1$s </code>' ) . " <br /> " , $mem -> user [ " lastip " ]);
}
echo " </p> " ;
2006-04-26 12:28:53 +00:00
if ( $mem -> user [ " lastfail " ]) {
printf ( _ ( " %1 \$ d login failed since last login " ) . " <br /> " , $mem -> user [ " lastfail " ]);
}
2013-10-18 09:59:03 +00:00
if ( ! empty ( $error ) ) { echo " <p class='alert alert-danger'> $error </p> " ; $error = '' ; }
2013-02-05 11:50:54 +00:00
2014-03-20 13:28:45 +00:00
$feed_url = variable_get ( 'rss_feed' , '' , 'This is an RSS feed that will be displayed on the users homepages when they log in.' , array ( array ( 'desc' => 'URL' , 'type' => 'string' )));
2012-08-23 18:54:26 +00:00
if ( ! empty ( $feed_url )) {
2014-01-21 08:35:15 +00:00
$cache_time = 60 * 5 ; // 5 minutes
$cache_file = " /tmp/alterncpanel_cache_main.rss " ;
$timedif = @ ( time () - filemtime ( $cache_file ));
2012-08-23 18:54:26 +00:00
2014-01-21 08:35:15 +00:00
if ( file_exists ( $cache_file ) && $timedif < $cache_time ) {
$string = file_get_contents ( $cache_file );
} else {
$string = file_get_contents ( " $feed_url " );
file_put_contents ( $cache_file , $string );
}
$xml = @ simplexml_load_string ( $string );
2006-04-26 12:28:53 +00:00
2014-01-21 08:35:15 +00:00
if ( ! $xml === FALSE ) {
echo '<div align="center"><table class="tedit" cellspacing="0" cellpadding="6">' ;
echo " <tr><th colspan='2'><a target='_blank' style='font-size: 18px;font-weight: bold;color: #10507C;' href=' " . $xml -> channel -> link . " '> " . $xml -> channel -> title . " </a><br/><i> " . $xml -> channel -> description . " </i></th></tr> " ;
//echo '<tr><th>'._("Title").'</th><th>'._("Date").'</th></tr>';
$count = 0 ;
$max = 5 ;
foreach ( $xml -> channel -> item as $val ) {
if ( $count < $max ) {
echo " <tr> \n <td " . ( empty ( $val -> pubDate ) ? 'colpan=2' : '' ) . '><a target="_blank" href="' . $val -> link . '">' . $val -> title . '</a></td>' ;
if ( ! empty ( $val -> pubDate )) {
echo '<td>' . strftime ( " %d/%m/%Y " , strtotime ( $val -> pubDate )) . '</td>' ;
}
echo '</tr>' ;
}
$count ++ ;
} //foreach
echo " </table></div> \n " ;
echo " <br/> " ;
} // $xml === FALSE
2012-08-23 18:54:26 +00:00
} // empty feed_url
2008-02-01 23:03:53 +00:00
2006-04-26 12:28:53 +00:00
if ( $admin -> enabled ) {
$expiring = $admin -> renew_get_expiring_accounts ();
2013-02-18 10:01:28 +00:00
if ( ! empty ( $expiring ) ) {
2006-04-26 12:28:53 +00:00
echo " <h2> " . _ ( " Expired or about to expire accounts " ) . " </h2> \n " ;
echo " <table cellspacing= \" 2 \" cellpadding= \" 4 \" > \n " ;
echo " <tr><th> " . _ ( " uid " ) . " </th><th> " . _ ( " Last name, surname " ) . " </th><th> " . _ ( " Expiry " ) . " </th></tr> \n " ;
2012-10-29 09:08:24 +00:00
if ( is_array ( $expiring )) {
2013-04-19 12:39:51 +00:00
foreach ( $expiring as $account ) {
echo " <tr class= \" exp { $account [ 'status' ] } \" ><td> { $account [ 'uid' ] } </td> " ;
if ( $admin -> checkcreator ( $account [ 'uid' ])) {
echo " <td><a href= \" adm_edit.php?uid= { $account [ 'uid' ] } \" > { $account [ 'nom' ] } , { $account [ 'prenom' ] } </a></td> " ;
} else {
echo " <td> { $account [ 'nom' ] } , { $account [ 'prenom' ] } </td> " ;
}
2012-10-29 09:08:24 +00:00
echo " <td> { $account [ 'expiry' ] } </td></tr> \n " ;
}
2006-04-26 12:28:53 +00:00
}
echo " </table> \n " ;
}
2012-10-29 09:08:24 +00:00
echo " <hr/><p> " ;
2013-02-05 11:50:54 +00:00
__ ( " You are using the AlternC Panel. You can contact the AlternC community for information or feedback by joining the mailing-list " );
2013-04-19 12:39:51 +00:00
echo " <a target='_blank' href='http://lists.alternc.org/listinfo/users'>users@alternc.org</a> " ;
2012-10-29 09:08:24 +00:00
echo " </p> " ;
} // if $admin->enabled
2006-04-26 12:28:53 +00:00
2012-08-25 13:31:35 +00:00
$c = $admin -> get ( $cuid );
2009-09-08 05:29:38 +00:00
2010-06-03 08:41:37 +00:00
define ( " QUOTASONE " , " 1 " );
2012-08-24 09:46:00 +00:00
echo " <hr/> " ;
2010-06-03 08:41:37 +00:00
require_once ( " quotas_oneuser.php " );
2009-09-08 05:29:38 +00:00
?>
< ? php include_once ( " foot.php " ); ?>