Commit ff6c9ff6 authored by Alan Garcia's avatar Alan Garcia
Browse files

Commit "bourrin", beaucoup de choses.

 - Nouvelle interface de mail, elle n'est pas terminée mais est bien avancée
 - Beaucoup de correction php (notice)
 - Premier jet de la gestion de tache planifiées (cron)
 - Ajout d'un mode de debug pour l'admin

Reste en ToDo :
 - pas mal de fixme dans le code
 - corriger le schema de base pour les mails (Squidly a tout ce qu'il faut, il faut qu'il le commit)
 - configuration Dovecot et Postfix a commiter (pareil, Squidly à tout, plukacommiter) 
 - suppression de mail
 - et beaucoup de debug...

Maintenant que le gros est commité, attendez-vous à beaucoup de petit commit.
parent 20103063
......@@ -85,12 +85,14 @@ bureau/admin/aide/inline/tiret.gif -text
bureau/admin/alternc.jpg -text
bureau/admin/alternc.png -text
bureau/admin/alternc3.png -text
bureau/admin/alternc_debugme.php -text
bureau/admin/bro_editor.php -text
bureau/admin/bro_main.php -text
bureau/admin/bro_pref.php -text
bureau/admin/bro_tgzdown.php -text
bureau/admin/bro_view.php -text
bureau/admin/browseforfolder.php -text
bureau/admin/cron.php -text
bureau/admin/direct.php -text
bureau/admin/dom_add.php -text
bureau/admin/dom_doadd.php -text
......@@ -161,6 +163,8 @@ bureau/admin/icon/zip.png -text
bureau/admin/images/admin.png -text
bureau/admin/images/bgborder.gif -text
bureau/admin/images/blank.gif -text
bureau/admin/images/check_no.png -text
bureau/admin/images/check_ok.png -text
bureau/admin/images/config.png -text
bureau/admin/images/delete.png -text
bureau/admin/images/dom.png -text
......@@ -203,6 +207,9 @@ bureau/admin/images/password.png -text
bureau/admin/images/passwordstrength.jpg -text
bureau/admin/images/plus.png -text
bureau/admin/images/quota.png -text
bureau/admin/images/row-down.png -text
bureau/admin/images/row-down.png2 -text
bureau/admin/images/schedule.png -text
bureau/admin/images/stat.png -text
bureau/admin/index.php -text
bureau/admin/ip_main.php -text
......@@ -234,12 +241,17 @@ bureau/admin/login.php -text
bureau/admin/logo.png -text
bureau/admin/logo2.png -text
bureau/admin/mail_add.php -text
bureau/admin/mail_del.php -text
bureau/admin/mail_alias_create.inc.php -text
bureau/admin/mail_alias_doedit.php -text
bureau/admin/mail_doadd.php -text
bureau/admin/mail_dodel.php -text
bureau/admin/mail_doedit.php -text
bureau/admin/mail_edit.php -text
bureau/admin/mail_edit.inc.php -text
bureau/admin/mail_list.php -text
bureau/admin/mail_localbox_doedit.php -text
bureau/admin/mail_localbox_edit.inc.php -text
bureau/admin/mail_properties.php -text
bureau/admin/mail_redirection_doedit.php -text
bureau/admin/mail_redirection_edit.inc.php -text
bureau/admin/main.php -text
bureau/admin/mem_admin.php -text
bureau/admin/mem_chgmail.php -text
......@@ -252,6 +264,7 @@ bureau/admin/menu.php -text
bureau/admin/menu_adm.php -text
bureau/admin/menu_aide.php -text
bureau/admin/menu_brouteur.php -text
bureau/admin/menu_cron.php -text
bureau/admin/menu_dom.php -text
bureau/admin/menu_ftp.php -text
bureau/admin/menu_ip.php -text
......@@ -314,6 +327,8 @@ bureau/class/local.php -text
bureau/class/m_admin.php -text
bureau/class/m_authip.php -text
bureau/class/m_bro.php -text
bureau/class/m_cron.php -text
bureau/class/m_debug_alternc.php -text
bureau/class/m_dom.php -text
bureau/class/m_err.php -text
bureau/class/m_export.php -text
......@@ -321,6 +336,10 @@ bureau/class/m_ftp.php -text
bureau/class/m_hooks.php -text
bureau/class/m_hta.php -text
bureau/class/m_mail.php -text
bureau/class/m_mail_alias.php -text
bureau/class/m_mail_jabber.php -text
bureau/class/m_mail_localbox.php -text
bureau/class/m_mail_redirection.php -text
bureau/class/m_mem.php -text
bureau/class/m_mysql.php -text
bureau/class/m_quota.php -text
......
......@@ -43,9 +43,9 @@ include_once("head.php");
<br />
<?php
if ($error) {
echo "<p class=\"error\">$error</p>";
}
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
}
?>
<p>
......
......@@ -59,7 +59,7 @@ if (! $d=$dom->domains_type_get($name)) {
<hr id="topbar"/>
<br />
<?php
if ($error_edit) {
if (isset($error_edit) && $error_edit) {
echo "<p class=\"error\">$error_edit</p>";
$error_edit="";
......
......@@ -67,7 +67,7 @@ $r=$admin->get_list($show == 'all' ? 1 : 0, $creator);
<hr id="topbar"/>
<br />
<?php
if ($error) {
if (isset($error) && $error ) {
echo "<p class=\"error\">$error</p>";
}
?>
......@@ -75,7 +75,7 @@ $r=$admin->get_list($show == 'all' ? 1 : 0, $creator);
<?php __("Here is the list of hosted AlternC accounts"); ?> (<?php printf(_("%s accounts"),count($r)); ?>)
&nbsp;
<?php if($_REQUEST['show'] != 'all') {
<?php if($show != 'all') {
echo '<p><span class="ina"><a href="adm_list.php?show=all">' . _('List all AlternC accounts') . '</a></span>';
if ($subadmin!=0 || $cuid==2000) {
$list_creators = $admin->get_creator_list();
......
......@@ -37,7 +37,7 @@ require_once("../class/config.php");
// * with no parameter when the admin want to go back to his admin account.
if (!$_REQUEST["id"] && $_COOKIE["oldid"]) {
if ( ( !isset($_REQUEST["id"]) || !$_REQUEST["id"]) && $_COOKIE["oldid"]) {
// We check the cookie's value :
list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]);
$newuid=intval($newuid);
......@@ -119,4 +119,4 @@ if ($error) {
include_once("foot.php");
?>
\ No newline at end of file
?>
......@@ -41,11 +41,11 @@ include_once("head.php");
<hr id="topbar"/>
<br />
<?php
if ($error) {
echo "<p class=\"error\">$error</p>";
include_once("foot.php");
exit;
}
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
include_once("foot.php");
exit;
}
?>
<ul id="adm_panel">
<li class="lst1"><a href="adm_tld.php"><?php __("Manage allowed domains (TLD)"); ?></a></li>
......
<?php
require_once("../class/config.php");
$fields = array (
"enable" => array("request","string","0")
);
getFields($fields);
print_r($enable);
if ($enable) {
$debug_alternc->activate();
} else {
$debug_alternc->desactivate();
}
header("Location: /main.php");
?>
<?php
require_once("../class/config.php");
include_once("head.php");
if (isset($_POST['cron']) && is_array($_POST['cron'])) {
if (! $cron->update($_POST['cron'])) {
$error=_("There was an error during the record.");
} else {
$error=_("Save done.");
}
}
$lst_cron = $cron->lst_cron();
?>
<h3><?php __("Scheduled tasks"); ?></h3>
<hr id="topbar"/>
<br />
<?php if (isset($error) && $error) { ?>
<p class="error"><?php echo $error ?></p>
<?php } ?>
<form method="post" action="cron.php" id="main" name="cron" >
<table>
<tr>
<th><?php __("URL"); ?></th>
<th><?php __("Schedule"); ?></th>
<th><?php __("User"); ?></th>
<th><?php __("Password"); ?></th>
<th><?php __("Email report"); ?></th>
</tr>
<?php
$max_cron = $quota->getquota("cron");
$max_cron = $max_cron['t'];
if ( sizeof($lst_cron) > $max_cron ) $max_cron=sizeof($lst_cron);
for ($i=0; $i < $max_cron ; $i++) {
?>
<tr>
<?php if (isset($lst_cron[$i])) echo "<input type='hidden' name='cron[$i][id]' value='".$lst_cron[$i]['id']."' />"; ?>
<td><input type="text" name="<?php echo "cron[$i][url]";?>" size="30" maxlength="255" value="<?php if (isset($lst_cron[$i]['url'])) { echo htmlentities($lst_cron[$i]['url']);} ?>"/></td>
<td>
<select name='cron[<?php echo $i; ?>][schedule]'>
<?php
foreach ($cron->schedule() as $cs) {
echo "<option value='".$cs['unit']."'";
if (isset($lst_cron[$i]['schedule']) && ($lst_cron[$i]['schedule'] == $cs['unit'])){
echo " selected ";
}
echo " >".$cs['name'];
echo "</option>";
}
?>
</select>
</td>
<td><input type="text" name="<?php echo "cron[$i][user]";?>" size="10" maxlength="64" value="<?php if (isset($lst_cron[$i]['user'])) { echo htmlentities($lst_cron[$i]['user']);} ?>"/></td>
<td><input type="text" name="<?php echo "cron[$i][password]";?>" size="10" maxlength="64" value="<?php if (isset($lst_cron[$i]['password'])) { echo htmlentities($lst_cron[$i]['password']);} ?>"/></td>
<td><input type="text" name="<?php echo "cron[$i][email]";?>" size="10" maxlength="64" value="<?php if (isset($lst_cron[$i]['email'])) { echo htmlentities($lst_cron[$i]['email']);} ?>"/></td>
</tr>
<?php } //foreach ?>
</table>
<input type="submit" name="submit" class="inb" value="<?php __("Save"); ?>" />
</form>
<?php include_once("foot.php"); ?>
......@@ -131,7 +131,7 @@ for($i=0;$i<$r["nsub"];$i++) {
switch ($r['sub'][$i]['enable']) {
case 'ENABLED':
__("Enabled");
echo "<br/><a href='dom_substatus.php?domain=".urlencode($r["name"])."&amp;sub=".urlencode($r["sub"][$i]["name"])."&amp;type=".urlencode($r["sub"][$i]["type"])."&amp;value=".urlencode($r["sub"][$i]['dest'])."&status=disable'>";__("Disable");echo "</a>";
echo "<br/><a href='dom_substatus.php?domain=".urlencode($r["name"])."&amp;sub=".urlencode($r["sub"][$i]["name"])."&amp;type=".urlencode($r["sub"][$i]["type"])."&amp;value=".urlencode($r["sub"][$i]['dest'])."&amp;status=disable'>";__("Disable");echo "</a>";
break;
case 'ENABLE':
__("Activation pending");
......@@ -208,7 +208,7 @@ if (!$r['noerase']) {
<input type="submit" class="inb" name="submit" value="<?php __("Submit the changes"); ?>" />
</form>
<p>&nbsp</p>
<p>&nbsp;</p>
<hr />
<h3><?php __("Domain removal"); ?></h3>
......
......@@ -58,8 +58,8 @@ if (!$noread) {
echo "<h3>";
__("Editing subdomain");
echo " http://"; ecif($sub,$sub."."); echo $domain."</h3>";
if ($error) {
echo "<p class=\"error\">$error</p>";
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
include_once("foot.php");
exit();
}
......
......@@ -3,5 +3,10 @@
</tr>
</table>
</div> <!-- div global -->
<?php
if ( $debug_alternc->status ) {
$debug_alternc->dump();
}
?>
</body>
</html>
......@@ -47,11 +47,11 @@ if (!$id) {
?>
<h3><?php __("Editing an FTP account"); ?></h3>
<?php
if ($error) {
echo "<p class=\"error\">$error</p>";
include_once("foot.php");
exit();
}
if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>";
include_once("foot.php");
exit();
}
?>
<form method="post" action="ftp_doedit.php" name="main" id="main">
<table border="1" cellspacing="0" cellpadding="4">
......
......@@ -47,7 +47,7 @@ if (!$r=$ftp->get_list($domain)) {
<br />
<?php
if ($error && !$noftp) {
if (isset($error) && $error && !$noftp) {
?>
<p class="error"><?php echo $error ?></p>
<?php } ?>
......
......@@ -62,11 +62,11 @@ if (!$charset) $charset="UTF-8";
<p>&nbsp;</p>
<?php if (isset($error) && $error) echo "<font color=red>$error</font>"; ?>
<?php
$authip_token=$_GET['authip_token'];
if (isset($_GET['authip_token'])) $authip_token=$_GET['authip_token'];
/*
if (!$_SERVER[HTTPS]) {
echo "<h4>ATTENTION : vous allez accder votre panel en mode *non scuris*<br/>
<a href=\"https://".$_SERVER["HTTP_HOST"]."/admin/\">Cliquez ici pour passer en mode scuris</a></h4>";
<a href=\"https://".$_SERVER["HTTP_HOST"]."/\">Cliquez ici pour passer en mode scuris</a></h4>";
}
*/
?>
......
......@@ -51,19 +51,23 @@ $lac = $authip->list_affected();
<hr id="topbar"/>
<br />
<?php if ($error) { ?>
<?php if (isset($error) && $error) { ?>
<p class="error"><?php echo $error ?></p>
<?php } ?>
<table>
<h3><?php __("Enabled rules"); ?></h3>
<table class="tlist">
<tr>
<th><?php __("Protocol");?></th>
<th><?php __("Target");?></th>
<th><?php __("IP address");?></th>
</tr>
<?php
$col=1;
foreach ($lac as $ll) {
echo "<tr>";
$col=3-$col;
echo "<tr class='lst$col' >";
echo "<td>".$ac[$ll['protocol']]['name']."</td>";
echo "<td>".$ac[$ll['protocol']]['values'][$ll['parameters']]."</td>";
echo "<td>".$list_ip[$ll['authorised_ip_id']]['infos']."<br/>".$list_ip[$ll['authorised_ip_id']]['ip_human']."</td>"; ?>
......@@ -75,13 +79,14 @@ $lac = $authip->list_affected();
</table>
</p>
<fieldset><legend><?php __("Add a new rule"); ?></legend>
<hr/>
<h3><?php __("Add a new rule"); ?></h3>
<form method="post" action="ip_main.php" name="main" id="main">
<table>
<table class="tlist">
<thead>
<th><?php __("Target"); ?></th>
<th><?php __("IP address (or subnet)"); ?></th>
<th/>
<td/>
</thead>
<tbody>
<tr valign="top">
......@@ -121,18 +126,18 @@ $lac = $authip->list_affected();
</tbody>
</table>
</form>
</fieldset>
<table>
<tr>
<th colspan=2><?php __("IP address");?></th>
</tr>
<hr/>
<h3><?php __("Know IP and networks");?></h3>
<table class="tlist">
<tr>
<td valign=top>
<td valign=top width=40%>
<table>
<tr><th><?php __("Type"); ?></th><th><?php __("IP"); ?></th><th><?php __("Informations"); ?></th><th colspan=2/></tr>
<?php foreach($list_ip as $i) {
<?php
$col=1;
foreach($list_ip as $i) {
$col=3-$col;
if (checkip($i['ip'])) {
if ($i['subnet']==32) {
$txt="Address IPv4";
......@@ -146,7 +151,7 @@ $lac = $authip->list_affected();
$txt="Subnet IPv6";
}
}
echo "<tr><td>$txt</td><td>{$i['ip_human']}</td><td>{$i['infos']}</td>";
echo "<tr class='lst$col' ><td>$txt</td><td>{$i['ip_human']}</td><td>{$i['infos']}</td>";
?>
<td><div class="ina"><a href="javascript:edit_ip(<?php echo "'".htmlentities($i['id'])."','".htmlentities($i['ip_human'])."','".htmlentities($i['infos'])."'"; ?>);"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div></td>
<td><div class="ina"><a href="ip_main.php?delete_id=<?php echo urlencode($i["id"]) ?>"><img src="images/delete.png" alt="<?php __("Delete"); ?>" /><?php __("Delete"); ?></a></div></td>
......@@ -155,7 +160,7 @@ $lac = $authip->list_affected();
<?php } ?>
</table>
</td>
<td valign=top>
<td valign=top width=40%>
<fieldset>
<legend><?php __("Add an IP");?> - <a href="javascript:edit_ip('','<?php echo htmlentities($_SERVER['REMOTE_ADDR'])."','Home IP'";?>);" ><?php echo __("Add my current IP"); ?></a></legend>
<span id="form_add_ip">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment