Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
main.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  AlternC - Web Hosting System
5  Copyright (C) 2000-2012 by the AlternC Development Team.
6  https://alternc.org/
7  ----------------------------------------------------------------------
8  LICENSE
9 
10  This program is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License (GPL)
12  as published by the Free Software Foundation; either version 2
13  of the License, or (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  To read the license please visit http://www.gnu.org/copyleft/gpl.html
21  ----------------------------------------------------------------------
22  Purpose of file: Main page shown after login, display misc information
23  ----------------------------------------------------------------------
24 */
25 require_once("../class/config.php");
26 
27 include_once("head.php");
28 
29 // Show last login information :
30 echo "<p>";
31 __("Last Login: ");
32 
33 if ($mem->user["lastlogin"]=="0000-00-00 00:00:00") {
34  __("Never");
35 } else {
36  echo format_date(_('the %3$d-%2$d-%1$d at %4$d:%5$02d'),$mem->user["lastlogin"]);
37  printf("&nbsp;"._('from: <code> %1$s </code>')."<br />",$mem->user["lastip"]);
38 }
39  echo "</p>";
40 
41 if ($mem->user["lastfail"]) {
42  printf(_("%1\$d login failed since last login")."<br />",$mem->user["lastfail"]);
43 }
44 
45 if (!empty($error) ) { echo "<p class='alert alert-danger'>$error</p>";$error=''; }
46 
47 $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')));
48 if (!empty($feed_url)) {
49  $cache_time = 60*5; // 5 minutes
50  $cache_file = "/tmp/alterncpanel_cache_main.rss";
51  $timedif = @(time() - filemtime($cache_file));
52 
53  if (file_exists($cache_file) && $timedif < $cache_time) {
54  $string = file_get_contents($cache_file);
55  } else {
56  $string = file_get_contents("$feed_url");
57  file_put_contents($cache_file,$string);
58  }
59  $xml = @simplexml_load_string($string);
60 
61  if ( ! $xml === FALSE ) {
62  echo '<div align="center"><table class="tedit" cellspacing="0" cellpadding="6">';
63  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>";
64  //echo '<tr><th>'._("Title").'</th><th>'._("Date").'</th></tr>';
65  $count = 0;
66  $max = 5;
67  foreach ($xml->channel->item as $val) {
68  if ($count < $max) {
69  echo "<tr>\n<td ".(empty($val->pubDate)?'colpan=2':'').'><a target="_blank" href="'.$val->link.'">'.$val->title.'</a></td>';
70  if (!empty($val->pubDate)) {
71  echo '<td>'.strftime("%d/%m/%Y" , strtotime($val->pubDate)).'</td>';
72  }
73  echo '</tr>';
74  }
75  $count++;
76  } //foreach
77  echo "</table></div>\n";
78  echo "<br/>";
79  } // $xml === FALSE
80 } // empty feed_url
81 
82 if($admin->enabled) {
83  $expiring = $admin->renew_get_expiring_accounts();
84 
85  if(!empty($expiring) ) {
86  echo "<h2>" . _("Expired or about to expire accounts") . "</h2>\n";
87  echo "<table cellspacing=\"2\" cellpadding=\"4\">\n";
88  echo "<tr><th>"._("uid")."</th><th>"._("Last name, surname")."</th><th>"._("Expiry")."</th></tr>\n";
89  if (is_array($expiring)) {
90  foreach($expiring as $account) {
91  echo "<tr class=\"exp{$account['status']}\"><td>{$account['uid']}</td>";
92  if($admin->checkcreator($account['uid'])) {
93  echo "<td><a href=\"adm_edit.php?uid={$account['uid']}\">{$account['nom']}, {$account['prenom']}</a></td>";
94  }else{
95  echo "<td>{$account['nom']}, {$account['prenom']}</td>";
96  }
97  echo "<td>{$account['expiry']}</td></tr>\n";
98  }
99  }
100  echo "</table>\n";
101  }
102 
103  echo "<hr/><p>";
104  __("You are using the AlternC Panel. You can contact the AlternC community for information or feedback by joining the mailing-list");
105  echo "&nbsp;<a target='_blank' href='http://lists.alternc.org/listinfo/users'>users@alternc.org</a>";
106  echo "</p>";
107 } // if $admin->enabled
108 
109 $c = $admin->get($cuid);
110 
111 define("QUOTASONE","1");
112 echo "<hr/>";
113 require_once("quotas_oneuser.php");
114 
115 
116 ?>
117 <?php include_once("foot.php"); ?>