Commit 3c61c6f2 authored by fred's avatar fred

Merge branch 'stable-1.0' into wip/domainepublic-1.0

Conflicts:
	bureau/admin/main.php
	bureau/admin/menu.php
	bureau/admin/menu_adm.php
	bureau/admin/menu_aide.php
	bureau/admin/menu_brouteur.php
	bureau/admin/menu_mail.php
	bureau/admin/menu_sql.php
	bureau/admin/styles/base.css
	bureau/admin/webmail/index.php
	bureau/class/config.php
	bureau/class/config_real.php
	bureau/class/functions.php
	bureau/class/local.php
	bureau/class/m_admin.php
	bureau/class/m_dom.php
	bureau/class/m_mail.php
	debian/po/fr.po
	debian/po/templates.pot
	src/mail_add
	src/rawstat.daily
parents daf5ffbf f663cc8e
This diff is collapsed.
/build-stamp
debian/.svnignore
debian/alternc
debian/alternc-slave
debian/alternc-slave.debhelper.log
debian/alternc-slave.postrm.debhelper
debian/alternc-slave.substvars
debian/alternc.debhelper.log
debian/alternc.postrm.debhelper
debian/alternc.substvars
debian/files
po/fr/LC_MESSAGES/alternc-admintools.mo
build-stamp
\ No newline at end of file
[main]
host = https://www.transifex.net
[alternc.messages]
source_file = bureau/locales/messages.pot
source_lang = en
trans.fr_FR = bureau/locales/fr_FR/LC_MESSAGES/messages.po
trans.es_ES = bureau/locales/es_ES/LC_MESSAGES/messages.po
trans.pt_BR = bureau/locales/pt_BR/LC_MESSAGES/messages.po
trans.en_US = bureau/locales/en_US/LC_MESSAGES/messages.po
trans.de_DE = bureau/locales/de_DE/LC_MESSAGES/messages.po
[alternc.manual]
source_file = bureau/locales/manual.pot
source_lang = en
trans.fr_FR = bureau/locales/fr_FR/LC_MESSAGES/manual.po
trans.es_ES = bureau/locales/es_ES/LC_MESSAGES/manual.po
trans.pt_BR = bureau/locales/pt_BR/LC_MESSAGES/manual.po
trans.en_US = bureau/locales/en_US/LC_MESSAGES/manual.po
trans.de_DE = bureau/locales/de_DE/LC_MESSAGES/manual.po
[alternc.alterncadmintools]
source_file = po/alternc-admintools.pot
source_lang = en
trans.fr_FR = po/fr/LC_MESSAGES/alternc-admintools.po
[alternc.debian]
source_file = debian/po/templates.pot
source_lang = en
trans.fr_FR = debian/po/fr.po
......@@ -43,4 +43,4 @@ then apt-get install alternc
You may download and install additionnal plugins after installing AlternC.
Let's go to the developper page for more information.
https://dev.alternc.org/trac/alternc/
https://alternc.org/
......@@ -49,5 +49,5 @@ Note: vous pouvez aussi installer les modules additionnels d'AlternC par
la suite. Pour plus d'information, rendez-vous sur le serveur de
développement à l'adresse :
https://dev.alternc.org/trac/alternc/
https://alternc.org/
......@@ -30,57 +30,58 @@
----------------------------------------------------------------------
*/
require_once("../class/config.php");
include_once("head.php");
if (!$admin->enabled) {
__("This page is restricted to authorized staff");
exit();
}
if (!isset($canpass)) $canpass=1;
include("head.php");
$fields = array (
"canpass" => array ("request", "integer", 1),
);
getFields($fields);
?>
</head>
<body>
<h3><?php __("New member"); ?></h3>
<h3><?php __("New AlternC account"); ?></h3>
<hr id="topbar"/>
<br />
<?php
if ($error) {
echo "<p class=\"error\">$error</p>";
}
?>
<form method="post" action="adm_doadd.php">
<table border="1" cellspacing="0" cellpadding="4">
<form method="post" action="adm_doadd.php" id="main" name="main">
<table class="tedit">
<tr><th><label for="login"><?php __("Username"); ?></label></th><td>
<input type="text" class="int" name="login" id="login" value="<?php echo $login; ?>" size="20" maxlength="64" />
<input type="text" class="int" name="login" id="login" value="<?php ehe($login); ?>" size="20" maxlength="16" />
</td></tr>
<tr>
<th><label for="pass"><?php __("Initial password"); ?></label></th>
<td><input type="password" id="pass" name="pass" class="int" value="<?php echo $pass; ?>" size="20" maxlength="64" /></td>
<td><input type="password" id="pass" name="pass" class="int" value="<?php ehe($pass); ?>" size="20" maxlength="64" /></td>
</tr>
<tr>
<th><label for="passconf"><?php __("Confirm password"); ?></label></th>
<td><input type="password" id="passconf" name="passconf" class="int" value="<?php echo $passconf; ?>" size="20" maxlength="64" /></td>
<td><input type="password" id="passconf" name="passconf" class="int" value="<?php ehe($passconf); ?>" size="20" maxlength="64" /></td>
</tr>
<tr>
<th><label for="canpass"><?php __("Can he change its password"); ?></label></th>
<td><select class="inl" name="canpass" id="canpass">
<?php
for($i=0;$i<count($bro->l_icons);$i++) {
echo "<option";
if ($canpass==$i) echo " selected=\"selected\"";
echo " value=\"$i\">"._($bro->l_icons[$i])."</option>";
}
?></select>
<td>
<input type="radio" class="inc" id="canpass0" name="canpass" value="0"<?php cbox($canpass==0); ?>><label for="canpass0"><?php __("No"); ?></label><br />
<input type="radio" class="inc" id="canpass1" name="canpass" value="1"<?php cbox($canpass==1); ?>><label for="canpass1"><?php __("Yes"); ?></label><br />
</td>
</tr>
<tr>
<th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th>
<td><input class="int" type="text" id="nom" name="nom" value="<?php echo $nom; ?>" size="20" maxlength="128" />&nbsp;/&nbsp;<input type="text" name="prenom" id="prenom" value="<?php echo $prenom; ?>" class="int" size="20" maxlength="128" /></td>
<th><label for="notes"><?php __("Notes"); ?></label></th>
<td><textarea name="notes" id="notes" class="int" cols="32" rows="5"><?php echo $notes; ?></textarea></td>
</tr>
<tr>
<th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th>
<td><input class="int" type="text" id="nom" name="nom" value="<?php ehe($nom); ?>" size="20" maxlength="128" />&nbsp;/&nbsp;<input type="text" name="prenom" id="prenom" value="<?php ehe($prenom); ?>" class="int" size="20" maxlength="128" /></td>
</tr>
<tr>
<th><label for="nmail"><?php __("Email address"); ?></label></th>
<td><input type="text" name="nmail" id="nmail" class="int" value="<?php echo $nmail; ?>" size="30" maxlength="128" /></td>
<td><input type="text" name="nmail" id="nmail" class="int" value="<?php ehe($nmail); ?>" size="30" maxlength="128" /></td>
</tr>
<tr>
<th><label for="type"><?php __("Account type"); ?></label></th>
......@@ -95,31 +96,36 @@ if ($error) {
echo ">$type</option>";
}
?></select>
</td>
</td>
</tr>
<?php if (variable_get('hosting_tld') || $dom->enum_domains()) { ?>
<tr>
<th colspan="2">
<input type="checkbox" name="create_dom" value="1" />
<label><?php printf(_("Create the domain <b>username.%s</b>"),""); ?></label>
<select name="create_dom_list">
<input type="checkbox" name="create_dom" value="1" class="inc" id="create_dom" <?php cbox($create_dom==1); ?>/>
<label for="create_dom"><?php printf(_("Install the domain"),""); ?></label>
<span class="int" id="create_dom_list_pfx">login.</span><select name="create_dom_list" class="int" id="create_dom_list">
<?php if (variable_get('hosting_tld')) { ?>
<option value="<?php echo variable_get('hosting_tld'); ?>" selected="selected"><?php echo variable_get('hosting_tld'); ?></option>
<?php }
<option value="<?php echo variable_get('hosting_tld'); ?>" selected="selected"><?php echo variable_get('hosting_tld'); ?></option>
<?php }
/* Enumeration des domaines : */
$domain=$dom->enum_domains();
reset($domain);
while (list($key,$val)=each($domain)) { ?>
<option value="<?php echo $val; ?>" > <?php echo $val?> </option>
<option value="<?php echo $val; ?>" > <?php echo $val?> </option>
<?php } ?>
</select>
</th>
</tr>
<tr>
<td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create a new member"); ?>" /></td>
</tr>
<?php } ?>
<tr class="trbtn"><td colspan="2">
<input type="submit" class="inb" name="submit" value="<?php __("Create this AlternC account"); ?>" />
<input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" />
</td></tr>
</table>
</form>
<script type="text/javascript">
document.forms['main'].login.focus();
document.forms['main'].setAttribute('autocomplete', 'off');
</script>
</body>
</html>
<?php include_once("foot.php"); ?>
<?php
/*
$Id: adm_login.php,v 1.4 2005/04/01 17:13:10 benjamin Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
----------------------------------------------------------------------
Based on:
Valentin Lacambre's web hosting softwares: http://altern.org/
----------------------------------------------------------------------
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
----------------------------------------------------------------------
Original Author of file: Benjamin Sonntag
Purpose of file: Connect a super-user to another account
----------------------------------------------------------------------
*/
require_once("../class/config.php");
setcookie('oldid','',0,'/');
unset($_COOKIE['oldid']);
require_once("main.php");
......@@ -29,26 +29,23 @@
*/
require_once("../class/config.php");
include("head.php");
?>
</head>
<body>
<?php
include_once("head.php");
$uid = $_GET['uid'];
if (!$uid) {
__("Missing uid");
echo "</body></html>";
include_once("foot.php");
exit();
}
if (!$admin->enabled || !$admin->checkcreator($uid)) {
__("This page is restricted to authorized staff");
echo "</body></html>";
include_once("foot.php");
exit();
}
if (!$r=$admin->get($uid)) {
__("User does not exist");
echo "</body></html>";
include_once("foot.php");
exit();
}
......@@ -59,14 +56,16 @@ if (! ($confirmed = ($_GET['submit'] == _("Confirm")) ) ) {
?>
<form action="<?=$PHP_SELF?>" method="GET">
<input type="hidden" name="uid" value="<?=$uid?>" />
<? __("Redirection URL:") ?> <input type="text" name="redirect" value="http://example.com/" />
<input type="submit" name="submit" value="<?=_("Confirm")?>" />
<? __("Redirection URL:") ?> <input type="text" name="redirect" class="int" value="http://example.com/" />
<input type="submit" name="submit" class="inb" value="<?=_("Confirm")?>" />
<input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'"/>
</form><?php
print "<h3>" . _("Domains of user: ") . $r["login"] . "</h3>";
} else {
if (!$_GET['redirect']) {
__("Missing redirect url.");
include_once("foot.php");
exit();
} else {
$redirect = $_GET['redirect'];
......@@ -98,32 +97,32 @@ foreach ($domains as $key => $domain) {
}
$dom->unlock();
# 2. for each subdomain
foreach ($r['sub'] as $k => $sub) {
# shortcuts
$type = $sub['type'];
$dest = $sub['dest'];
$sub = $sub['name'];
# if it's a real website
if ($type == $dom->type_local) {
if (!$confirmed) {
print "<li>";
if ($sub) {
print $sub . '.';
}
print "$domain -> $dest</li>";
} else {
# 2.1 keep a copy of where it was, in an SQL request
$backup .= "UPDATE `sub_domaines` SET `type`='$type', valeur='$dest' WHERE `domaine`='$domain' AND sub='$sub';\n";
$backup .= "DELETE FROM `sub_domaines_standby` WHERE domaine='$domain' and sub='$sub';\n";
$backup .= "INSERT INTO sub_domaines_standby (compte,domaine,sub,valeur,type,action) values ('$cuid','$domain','$sub','$dest','$type',1);\n"; // UPDATE
# 2.2 change the subdomain to redirect to http://spam.koumbit.org/
$dom->lock();
if (!$dom->set_sub_domain($domain, $sub, $dom->type_url, "edit", $redirect)) {
print "-- error in $sub.$domain: " . $err->errstr() . "\n";
if (is_array($r['sub'])) {
foreach ($r['sub'] as $k => $sub) {
# shortcuts
$type = $sub['type'];
$dest = $sub['dest'];
$sub = $sub['name'];
# if it's a real website
if ($type == $dom->type_local) {
if (!$confirmed) {
print "<li>";
if ($sub) {
print $sub . '.';
}
print "$domain -> $dest</li>";
} else {
# 2.1 keep a copy of where it was, in an SQL request
$backup .= "UPDATE `sub_domaines` SET `type`='$type', valeur='$dest',web_action='UPDATE' WHERE `domaine`='$domain' AND sub='$sub';\n";
# 2.2 change the subdomain to redirect to http://spam.koumbit.org/
$dom->lock();
if (!$dom->set_sub_domain($domain, $sub, $dom->type_url, "edit", $redirect)) {
print "-- error in $sub.$domain: " . $err->errstr() . "\n";
}
$dom->unlock();
}
$dom->unlock();
}
}
}
......@@ -138,7 +137,7 @@ if ($confirmed) {
}
$cuid = $old_cuid;
include_once("foot.php");
?>
</body>
</html>
......@@ -36,25 +36,29 @@ if (!$admin->enabled) {
exit();
}
include("head.php");
include_once ("head.php");
?>
</head>
<body>
<h3><?php __("Change the default quotas"); ?></h3>
<hr id="topbar"/>
<br />
<?php
if ($error) {
echo "<p class=\"error\">$error</p>";
}
?>
<p><form method="post" action="adm_dodefquotas.php">
<input type="hidden" name="action" value="add">
<input type="text" name="type" class="int"></td>
<form method="post" action="adm_dodefquotas.php">
<p>
<input type="hidden" name="action" value="add" />
<input type="text" name="type" class="int" />
<input type="submit" class="inb" value="<?php __("Add account type"); ?>" />
</form></p>
</p>
</form>
<p><form method="post" action="adm_dodefquotas.php">
<input type="hidden" name="action" value="delete">
<form method="post" action="adm_dodefquotas.php">
<p>
<input type="hidden" name="action" value="delete" />
<select name="type" id="type" class="inl">
<?php
$db->query("SELECT distinct(type) FROM defquotas WHERE TYPE != 'default' ORDER by type");
......@@ -64,50 +68,45 @@ while($db->next_record()) {
}
?></select>
<input type="submit" class="inb" value="<?php __("Delete account type"); ?>" />
</form></p>
</p>
</form>
<p>
<?php __("Here is the list of the quotas on the server for the new accounts. If you want to change them, enter new values"); ?>
</p>
<form method="post" action="adm_dodefquotas.php">
<input type="hidden" name="action" value="modify">
<div>
<input type="hidden" name="action" value="modify" />
<?php
$col=1;
$qarray=$quota->qlist();
$qlist=$quota->getdefaults();
$aqlist = $quota->qlist();
reset($qlist);
foreach($qlist as $qname => $q)
{
foreach($qlist as $type => $q) {
?>
<h4><?php echo _("Accounts of type"). " \"" . $qname . "\"" ?></h4>
<div>
<h4><?php echo _("Accounts of type"). " \"$type\"" ?></h4>
<table border="0" cellpadding="4" cellspacing="0">
<tr><th><?php __("Quotas") ?></th><th><?php __("Default Value"); ?></th></tr>
<?php
foreach($aqlist as $aqtype => $aqname)
{
$key = $qname . ":" . $aqtype;
$col=3-$col;
foreach($q as $name => $value) {
$key = $type . ":" . $name;
$col=3-$col;
?>
<tr class="lst<?php echo $col; ?>">
<td><label for="<?php echo $key; ?>"><?php echo $aqname; ?></label></td>
<td><input type="text" class="int" size="16" maxlength="16" name="<?php echo $key; ?>" id="<?php echo $key; ?>" value="<?php echo $q[$aqtype]; ?>" /></td></tr>
<td><label for="<?php echo $key; ?>"><?php echo $qarray[$name]; ?></label></td>
<td><input type="text" class="int" size="16" maxlength="16" name="<?php echo $key; ?>" id="<?php echo $name; ?>" value="<?php ehe($value); ?>" /></td></tr>
<?php
}
}
?>
</table>
</div>
<?php
}
?>
<input type="submit" class="inb" value="<?php __("Edit the default quotas"); ?>" />
</div>
</form>
</body>
</html>
<?php include_once("foot.php"); ?>
<?php
/*
$Id: adm_dnsweberror.php,v 1.4 2004/11/29 17:27:04 anonymous Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright (C) 2002 by the AlternC Development Team.
http://alternc.org/
----------------------------------------------------------------------
Based on:
Valentin Lacambre's web hosting softwares: http://altern.org/
----------------------------------------------------------------------
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
----------------------------------------------------------------------
Original Author of file: Alan Garcia
Purpose of file: Report domains and websites having error in the DB
----------------------------------------------------------------------
*/
require_once("../class/config.php");
if (!$admin->enabled) {
__("This page is restricted to authorized staff");
exit();
}
include_once("head.php");
?>
<h3><?php __("Domains and Websites having errors"); ?></h3>
<hr id="topbar" />
<br />
<?php
if ($error) {
echo "<p class=\"error\">$error</p>";
}
?>
<p>
<h3><?php __("List of the websites having errors in the domain database."); ?></h3>
</p>
<table class="tlist">
<tr>
<th><?php __("Uid"); ?></th>
<th><?php __("Account"); ?></th>
<th><?php __("Domain name"); ?></th>
<th><?php __("FQDN"); ?></th>
<th><?php __("Value"); ?></th>
<th><?php __("Description"); ?></th>
<th><?php __("Web Result field"); ?></th>
</tr>
<?php
$pair=0;
$db->query("select sd.compte, m.login, sd.domaine, if(length(sub)>0,concat_ws('.',sd.sub,sd.domaine),sd.domaine) as fqdn, sd.valeur, dt.description, sd.web_result from sub_domaines sd,membres m, domaines_type dt where sd.web_action='OK' and length(sd.web_result)<>0 and upper(dt.name)=upper(sd.type) order by sd.domaine, sd.sub, sd.valeur;");
while($db->next_record()) {
++$pair;
print_r($d);
?>
<tr class="lst<?php echo $pair%2+1 ?>">
<td><?php echo $db->f('compte');?></td>
<td><?php echo $db->f('login');?> </td>
<td><?php echo $db->f('domaine');?> </td>
<td><?php echo $db->f('fqdn');?></td>
<td><?php echo $db->f('valeur');?></td>
<td><?php echo $db->f('description');?></td>
<td><?php echo $db->f('web_result');?></td>
</tr>
<?php } // end while ?>
</table>
<hr/>
<h3><?php __("List of the domain names having errors in the domain database."); ?></h3>
<table class="tlist">
<tr>
<th><?php __("Uid"); ?></th>
<th><?php __("Account"); ?></th>
<th><?php __("Domain name"); ?></th>
<th><?php __("DNS Result field"); ?></th>
</tr>
<?php
$pair=0;
$db->query("select d.compte, m.login, d.domaine, d.dns_result from domaines d, membres m where d.dns_action='OK' and dns_result <> 0 and dns_result <> '' and m.uid = d.compte;");
while($db->next_record()) {
++$pair;
print_r($d);
?>
<tr class="lst<?php echo $pair%2+1 ?>">
<td><?php echo $db->f('compte');?></td>
<td><?php echo $db->f('login');?> </td>
<td><?php echo $db->f('domaine');?> </td>
<td><?php echo $db->f('dns_result');?></td>
</tr>
<?php } // end while ?>
<?php include_once("foot.php"); ?>
......@@ -41,7 +41,7 @@ if ($pass != $passconf) {
include("adm_add.php");