...
 
Commits (49)
......@@ -34,14 +34,14 @@ include("head.php");
</head>
<body>
<h3>Bienvenue sur votre bureau AlternC.</h3>
<h3>Bienvenue <?php echo $mem->user["login"]; ?> sur votre bureau</h3>
<div id="info"><?php
// Show last login information :
__("Last Login: ");
echo format_date('the %3$d-%2$d-%1$d at %4$d:%5$d',$mem->user["lastlogin"]);
printf("&nbsp;"._('from: <code> %1$s </code>')."<br />",$mem->user["lastip"]);
echo format_date('le %3$d-%2$02d-%1$02d &aacute; %4$dh%5$02d',$mem->user["lastlogin"]);
printf("&nbsp;"._('depuis %1$s ')."<br />",$mem->user["lastip"]);
if ($mem->user["lastfail"]) {
printf(_("%1\$d login failed since last login")."<br />",$mem->user["lastfail"]);
......@@ -59,13 +59,10 @@ if ($inc && $rss_url) {
$rss = fetch_rss($rss_url);
if ($rss) {
echo "<h2>" . _("Latest news") . "</h2>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<h3><a href=$href>$title</a></h3>";
echo '<span class="date">'.$item['pubdate'] .'</span> - ';
echo '<span class="author">'.$item['dc']['creator'].'</span>';
echo $item['summary'];
}
}
......
......@@ -34,11 +34,14 @@ include("head.php");
<base target="right" />
</head>
<body id="menu">
<div id="alternc-logo"><a href="http://alternc.org"><!-- img src="alternc.png" width="120" height="82" border="0" alt="AlternC" / -->AlternC</a>
<span><?php echo "$L_VERSION"; ?></span>
<div id="alternc-logo"><a href="http://www.domainepublic.net">Domaine Public</a>
</div>
<h3>Menu <?php echo $mem->user["login"]; ?></h3>
<dl id="menu-list">
<dt id="home"><?php __("Front page") ?></dt>
<dd class="link"><a href="main.php"><?php __("Front page") ?></a></dd>
<dd class="link"><a href="/transat/profile#account">Profil</a></dd>
<dd><a href="quota_show.php"><?php __("Show my quotas"); ?></a></dd>
<dd><a href="http://www.aide-alternc.org/" target="help"><?php __("Online help"); ?></a></dd>
<?php
$MENUPATH="/var/alternc/bureau/admin/";
$tt=fopen("menulist.txt","rb");
......
......@@ -36,5 +36,10 @@ if ($mem->checkRight()) { ?>
<dt id="reseller"><?php __("Administration"); ?></dt>
<dd><a href="adm_list.php"><?php __("Manage the members"); ?></a></dd>
<dd><a href="adm_panel.php"><?php __("AlternC configuration"); ?></a></dd>
<dd><a href="/admin/sql/?server=2"><?php __("General SQL Admin"); ?></a></dd>
<?php }
<dd><a target="_blank" href="/admin/sql/?server=2"><?php __("General SQL Admin"); ?></a></dd>
<dt id="reseller">Transat</dt>
<dd><a href="../transat/accounts/list/">Membres</a></dd>
<dd><a href="../transat/accounts/adherents/">Adh&eacute;rents</a></dd>
<?php
}
?>
......@@ -29,4 +29,5 @@
*/
?>
<dd><a href="http://alternc.org/wiki/Documentation/Utilisateur" target="help"><?php __("Online help"); ?></a></dd>
<dt id="help"><?php __("Online help"); ?></dt>
<dd><a href="http://www.aide-alternc.org/" target="help"><?php __("Online help"); ?></a></dd>
......@@ -30,5 +30,7 @@
/* ############# BROUTEUR ############# */
?>
<dt id="browser"><?php __("Files and directories"); ?></dt>
<dt id="browser">Fichiers</dt>
<dd><a href="bro_main.php"><?php __("File browser"); ?></a></dd>
<dd><a href="ftp_list.php"><?php __("FTP accounts"); ?></a></dd>
<dd><a href="hta_list.php"><?php __("Protected folders"); ?></a></dd>
......@@ -44,3 +44,4 @@ $r=$quota->getquota("dom");
?>"><?php echo $val ?></a></dd>
<?php } ?>
<?php } ?>
<dd><a href="/transat/domains/invite/">Invitation</a></dd>
......@@ -30,8 +30,9 @@
$r=$quota->getquota("mysql");
if ($r["t"]) {
?>
<dt id="mysql">MySQL</dt>
<dt id="mysql">Bases de donn&eacute;es</dt>
<dd><a href="sql_users_list.php"><?php __("MySQL Users") ?></a></dd>
<dd><a href="sql_list.php"><?php __("Databases"); ?></a></dd>
<dd><a href="sql_users_list.php"><?php __("Users") ?></a></dd>
<dd><a target="_blank" href="sql_admin.php"><?php __("SQL Admin"); ?></a></dd>
<?php }
\ No newline at end of file
<?php }
<?php
/* taken from menu_sta2.php */
$q=$quota->getquota("stats");
$r=$quota->getquota("dom");
if ($q["t"]>0 && $r["u"]>0) {
?>
<dt id="webalizer">Statistiques</dt>
<dd><a href="webalizer_list.php"><?php __("Web Statistics"); ?></a></dd>
<?php } ?>
<?php
/* taken from menu_sta2.php */
$q=$quota->getquota("sta2");
$r=$quota->getquota("dom");
if ($q["t"]>0 && $r["u"]>0) {
?>
<!-- <dd><a href="sta2_list.php"><?php __("Raw web statistics"); ?></a></dd> -->
<?php } ?>
<dd><a href="../transat/webstats/">Webstats</a></dd>
<dd><a href="../transat/profile#logviewer">Visualiseur de logs</a></dd>
......@@ -143,16 +143,17 @@ body#menu h3 {
border-bottom: 1px solid #ccc;
}
#alternc-logo {
padding: .5em ;
padding: .5em;
text-align: center;
background-color: #CB781A;
}
#alternc-logo a {
color: #fff;
font-weight:bold;
text-decoration: none;
}
#menu-list dd a {
padding: 0 0 0 15px;
padding: 1px 0 1px 15px;
text-decoration: none;
}
......
<?php
include("/var/alternc/bureau/class/local.php");
header ("Location: https://$L_FQDN/webmail/") ;
header ("Location: /roundcube/");
?>
......@@ -57,10 +57,12 @@ register_shutdown_function("alternc_shutdown");
// 4. Acquire the semaphore : with that process,
sem_acquire( $alternc_sem );
/*
if (!get_magic_quotes_gpc()) {
echo "MAGIC QUOTES GPC IS DISABLED ! It's a bug in your php4 configuration, please fix it !!";
exit();
}
*/
if (ini_get("safe_mode")) {
echo "SAFE MODE IS ENABLED for the web panel ! It's a bug in your php4 or apache configuration, please fix it !!";
exit();
......@@ -69,8 +71,6 @@ if (ini_get("safe_mode")) {
/* PHPLIB inclusions : */
$root="/var/alternc/bureau/";
/* Server Domain Name */
$host=getenv("HTTP_HOST");
/* Global variables (AlternC configuration) */
require_once($root."class/local.php");
......@@ -79,12 +79,6 @@ require_once($root."class/db_mysql.php");
require_once($root."class/functions.php");
require_once($root."class/variables.php");
// Redirection si appel https://(!fqdn)/
if ($_SERVER["HTTPS"]=="on" && $host!=$L_FQDN) {
header("Location: https://$L_FQDN/");
}
// Classe hrite de la classe db de la phplib.
/**
* Class for MySQL management in the bureau
......
......@@ -52,11 +52,12 @@ register_shutdown_function("alternc_shutdown");
// 4. Acquire the semaphore : with that process,
sem_acquire( $alternc_sem );
/*
if (!get_magic_quotes_gpc()) {
echo "MAGIC QUOTES GPC IS DISABLED ! It's a bug in your php4 configuration, please fix it !!";
exit();
}
*/
/* PHPLIB inclusions : */
......@@ -164,4 +165,4 @@ for($i=0;$i<count($classes);$i++) {
}
?>
\ No newline at end of file
?>
......@@ -175,8 +175,15 @@ function checkfqdn($fqdn) {
while (list ($key, $val) = each ($members)) {
if (strlen($val)>63)
return 2;
if (!eregi("^[a-z0-9][a-z0-9-]*[a-z0-9]$",$val)) {
/*"*/ return 3;
if (strlen($val) == 1) {
/* special case domain with a single character */
if (!eregi("^[a-z0-9]$",$val)) {
/*"*/ return 3;
}
} else {
if (!eregi("^[a-z0-9][a-z0-9-]*[a-z0-9]$",$val)) {
/*"*/ return 3;
}
}
}
return $ret;
......
<?php
/* Read global variables (AlternC configuration) */
$L_VERSION="v. @@REPLACED_DURING_BUILD@@";
$L_VERSION="v. 0.9.8";
/* To ease the transition, we define a lookup table for old names */
$compat = array('DEFAULT_MX' => 'MX',
......
......@@ -180,16 +180,13 @@ class m_admin {
global $err,$mem,$db,$cuid;
// DONE PATCHBEN Check that the current user is editing one of it's own account !
// but ADMIN (always uid 2000) is almighty
if ($cuid==2000) {
return true;
}
$db->query("SELECT creator FROM membres WHERE uid='$uid';");
$db->next_record();
if ($db->Record[creator]!=$cuid) {
$err->raise("admin",1);
return false;
}
return true;
// FRED, 2010-04-08, en fait modifié pour que tous les admins soient
// considérés comme créateurs des comptes, comme ça chacun/e peut
// assurer l'administration de ceux-ci.
if ($this->enabled == 1)
return true;
return false;
}
/* ----------------------------------------------------------------- */
......
......@@ -284,7 +284,7 @@ class m_dom {
* et extrait du whois les serveurs DNS du domaine demand. En fonction
* du TLD, on sait (ou pas) faire le whois correspondant.
* Actuellement, les tld suivants sont supports :
* .com .net .org .be .info .ca .cx .fr .biz .name
* .com .net .org .be .eu .info .ca .cx .it .fr .biz .name .in .ws
*
* @param string $domain Domaine fqdn dont on souhaite les serveurs DNS
* @return array Retourne un tableau index avec les NOMS fqdn des dns
......@@ -314,7 +314,7 @@ class m_dom {
$serveur="whois.dns.be";
break;
case "eu":
$serveur="195.234.53.193";
$serveur="whois.eu";
break;
case "info":
$serveur="whois.afilias.net";
......@@ -338,9 +338,15 @@ class m_dom {
$serveur="whois.nic.name";
$egal="domain = ";
break;
case "in":
$serveur="whois.inregistry.net";
break;
case "ws":
$serveur="whois.samoanic.ws";
break;
# case "me":
# $serveur="whois.nic.me";
# break;
default:
$err->raise("dom",7);
return false;
......@@ -362,6 +368,7 @@ class m_dom {
case "net":
case "info":
case "biz":
case "in":
case "name":
if (ereg("Name Server:", $ligne)) {
$found = true;
......@@ -422,6 +429,7 @@ class m_dom {
}
}
break;
# case "me":
} // switch
} // while
fclose($fp);
......
......@@ -533,6 +533,9 @@ class m_mail {
$db->query("INSERT INTO mail_users (uid,alias,path,password) VALUES ('$cuid','".$mail."@".$dom."','/var/alternc/mail/".$m."/".$mail."_".$dom."','"._md5cr($pass)."');");
$db->query("INSERT INTO mail_alias (mail,alias) VALUES ('".$mail."_".$dom."','/var/alternc/mail/".$m."/".$mail."_".$dom."/Maildir/');");
exec("/usr/lib/alternc/mail_add ".$mail."_".$dom." ".$cuid);
return true;
$f=fopen("/var/lib/squirrelmail/data/".$mail."_".$dom.".pref","wb");
$g=0; $g=@fopen("/etc/squirrelmail/default_pref","rb");
fputs($f,"email_address=$mail@$dom\nchosen_theme=default_theme.php\n");
......
......@@ -398,7 +398,7 @@ Quelqu'un (peut-etre vous) a demand
Afin de confirmer que cet email est valide, merci de vous rendre l'adresse
ci-dessous :
https://$L_FQDN/admin/mem_cm.php?usr=$cuid&cookie=$COOKIE
https://bureau.domainepublic.net/admin/mem_cm.php?usr=$cuid&cookie=$COOKIE
(attention : si cette adresse est coupe sur 2 lignes, ne pas oublier de
reconstituer sur une seule ligne). Le bureau vous demandera la cl qui vous
......
......@@ -15,7 +15,7 @@ msgid ""
msgstr ""
"Project-Id-Version: AlternC 0.9.5\n"
"Report-Msgid-Bugs-To: alternc@packages.debian.org\n"
"POT-Creation-Date: 2008-10-04 11:47-0400\n"
"POT-Creation-Date: 2008-10-14 19:57-0400\n"
"PO-Revision-Date: 2006-04-26 11:16+0200\n"
"Last-Translator: Benjamin Sonntag <benjamin@sonntag.fr>\n"
"Language-Team: Team AlternC <team@alternc.org>\n"
......@@ -393,44 +393,15 @@ msgstr ""
"Adresse IP (ou ip/prefixe) du(des) serveur(s) dont qui pourront pinguer et "
"accéder au status apache (pour le monitoring de serveur). Facultatif."
#. Type: string
#. Description
#: ../templates:18001
msgid "trusted servers for bind:"
msgstr "serveurs de confiance pour bind : "
#. Type: string
#. Description
#: ../templates:18001
msgid ""
"IP address or prefix of trusted machines for DNS transfers, delimited by "
"';', optional."
msgstr ""
"Adresse IP ou classe d'IP des machines autorisées à utiliser le serveur DNS, "
"séparées par ';', facultatif."
#. Type: string
#. Description
#: ../templates:19001
msgid "SMTP authorized networks:"
msgstr "réseaux autorisés en SMTP : "
#. Type: string
#. Description
#: ../templates:19001
msgid "IP addresses of the networks authorized in SMTP, space-delimited."
msgstr ""
"Adresses ip des reseaux autorisés en SMTP (ou ip/prefixe) séparés par espace."
#. Type: note
#. Description
#: ../templates:20001
#: ../templates:18001
msgid "POP Before SMTP deprecated"
msgstr "POP Before SMTP déprécié"
#. Type: note
#. Description
#: ../templates:20001
#: ../templates:18001
msgid ""
"AlternC doesn't automatically configure the pop-before-smtp package anymore, "
"since it is correctly configured for SASL authentification these days. If "
......@@ -442,13 +413,13 @@ msgstr ""
#. Type: note
#. Description
#: ../templates:20001
#: ../templates:18001
msgid "# For Courier-POP3 and Courier-IMAP:"
msgstr "# For Courier-POP3 and Courier-IMAP:"
#. Type: note
#. Description
#: ../templates:20001
#: ../templates:18001
msgid ""
"in the /etc/pop-before-smtp/pop-before-smtp.conf and uncomment it. hash:/var/"
"lib/pop-before-smtp/hosts must also be added to the mynetworks directive of /"
......@@ -460,25 +431,25 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:21001
#: ../templates:19001
msgid "Should AlternC remove all databases (/var/lib/mysql/) ?"
msgstr "Les bases de données doivent elles être supprimés (/var/lib/mysql) ?"
#. Type: boolean
#. Description
#: ../templates:21001
#: ../templates:19001
msgid "All users databases will be trashed"
msgstr "Toutes les bases de données des utilisateurs seront perdues"
#. Type: boolean
#. Description
#: ../templates:22001
#: ../templates:20001
msgid "Should AlternC remove users datas ?"
msgstr "Les données des utilisateurs doivent elles êtres supprimés ?"
#. Type: boolean
#. Description
#: ../templates:22001
#: ../templates:20001
msgid "The files and apache redirections created by users will be trashed"
msgstr ""
"Les fichiers et les redirections d'apache créés par les utilisateurs seront "
......@@ -486,29 +457,47 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:23001
#: ../templates:21001
msgid "Should AlternC remove bind zones ?"
msgstr "Les zones de bind doivent elles être supprimées ?"
#. Type: boolean
#. Description
#: ../templates:23001
#: ../templates:21001
msgid "It will delete all bind zones created by AlternC"
msgstr "Cela supprimera toutes les zone de bind créées par AlternC"
#. Type: boolean
#. Description
#: ../templates:24001
#: ../templates:22001
msgid "Should AlternC remove bind mailboxes ?"
msgstr "Les boites mails doivent elles être supprimées ?"
#. Type: boolean
#. Description
#: ../templates:24001
#: ../templates:22001
msgid "If you accept all users e-mails will be deleted"
msgstr ""
"Si vous acceptez, toutes les e-mails des utilisateurs seront supprimées"
#~ msgid "trusted servers for bind:"
#~ msgstr "serveurs de confiance pour bind : "
#~ msgid ""
#~ "IP address or prefix of trusted machines for DNS transfers, delimited by "
#~ "';', optional."
#~ msgstr ""
#~ "Adresse IP ou classe d'IP des machines autorisées à utiliser le serveur "
#~ "DNS, séparées par ';', facultatif."
#~ msgid "SMTP authorized networks:"
#~ msgstr "réseaux autorisés en SMTP : "
#~ msgid "IP addresses of the networks authorized in SMTP, space-delimited."
#~ msgstr ""
#~ "Adresses ip des reseaux autorisés en SMTP (ou ip/prefixe) séparés par "
#~ "espace."
#~ msgid ""
#~ "If you still want to proceed with this installation, choose YES here, "
#~ "otherwise choose NO."
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: alternc@packages.debian.org\n"
"POT-Creation-Date: 2008-10-04 11:47-0400\n"
"POT-Creation-Date: 2008-10-14 19:57-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -329,41 +329,15 @@ msgid ""
"ping us and access apache status pages. Completely optional."
msgstr ""
#. Type: string
#. Description
#: ../templates:18001
msgid "trusted servers for bind:"
msgstr ""
#. Type: string
#. Description
#: ../templates:18001
msgid ""
"IP address or prefix of trusted machines for DNS transfers, delimited by "
"';', optional."
msgstr ""
#. Type: string
#. Description
#: ../templates:19001
msgid "SMTP authorized networks:"
msgstr ""
#. Type: string
#. Description
#: ../templates:19001
msgid "IP addresses of the networks authorized in SMTP, space-delimited."
msgstr ""
#. Type: note
#. Description
#: ../templates:20001
#: ../templates:18001
msgid "POP Before SMTP deprecated"
msgstr ""
#. Type: note
#. Description
#: ../templates:20001
#: ../templates:18001
msgid ""
"AlternC doesn't automatically configure the pop-before-smtp package anymore, "
"since it is correctly configured for SASL authentification these days. If "
......@@ -372,13 +346,13 @@ msgstr ""
#. Type: note
#. Description
#: ../templates:20001
#: ../templates:18001
msgid "# For Courier-POP3 and Courier-IMAP:"
msgstr ""
#. Type: note
#. Description
#: ../templates:20001
#: ../templates:18001
msgid ""
"in the /etc/pop-before-smtp/pop-before-smtp.conf and uncomment it. hash:/var/"
"lib/pop-before-smtp/hosts must also be added to the mynetworks directive of /"
......@@ -387,48 +361,48 @@ msgstr ""
#. Type: boolean
#. Description
#: ../templates:21001
#: ../templates:19001
msgid "Should AlternC remove all databases (/var/lib/mysql/) ?"
msgstr ""
#. Type: boolean
#. Description
#: ../templates:21001
#: ../templates:19001
msgid "All users databases will be trashed"
msgstr ""
#. Type: boolean
#. Description
#: ../templates:22001
#: ../templates:20001
msgid "Should AlternC remove users datas ?"
msgstr ""
#. Type: boolean
#. Description
#: ../templates:22001
#: ../templates:20001
msgid "The files and apache redirections created by users will be trashed"
msgstr ""
#. Type: boolean
#. Description
#: ../templates:23001
#: ../templates:21001
msgid "Should AlternC remove bind zones ?"
msgstr ""
#. Type: boolean
#. Description
#: ../templates:23001
#: ../templates:21001
msgid "It will delete all bind zones created by AlternC"
msgstr ""
#. Type: boolean
#. Description
#: ../templates:24001
#: ../templates:22001
msgid "Should AlternC remove bind mailboxes ?"
msgstr ""
#. Type: boolean
#. Description
#: ../templates:24001
#: ../templates:22001
msgid "If you accept all users e-mails will be deleted"
msgstr ""
<?php
// Restore register_globals-like behavior
// -_-
foreach ($_REQUEST as $key=>$val) {
${$key}=$val;
}
foreach ($_SERVER as $key=>$val) {
${$key}=$val;
}
foreach ($_COOKIE as $key=>$val) {
${$key}=$val;
}
foreach ($_POST as $key=>$val) {
${$key}=$val;
}
foreach ($_GET as $key=>$val) {
${$key}=$val;
}
?>
$TTL 1D
$TTL 3600
;
; BIND data file for domain @@DOMAINE@@
;
@ IN SOA %%ns1%%. root.%%fqdn%%. (
@@SERIAL@@ ; serial
21600 ; refresh (6h)
3600 ; retry (1h)
604800 ; expiry (7d)
86400 ) ; RR TTL (24h)
3H ; refresh
1H ; retry
3W ; expiry
1H ) ; RR TTL
IN NS %%ns1%%.
IN NS %%ns2%%.
......
......@@ -4,6 +4,8 @@ use strict;
my ($mailname,$uid) = @ARGV;
my $M_PATH = "/usr/bin/ssh -i /etc/alternc/ssh/id_rsa-mailadd -F /etc/alternc/ssh/ssh_config lucie.domainepublic.lan /usr/local/lib/alternc/mail_add";
if (!$mailname || !$uid) {
print "Usage: mail_add <mailname> <uid>\n";
print " Create the mail <mailname> for the alternc account having uid number <uid>\n";
......@@ -13,32 +15,12 @@ if (!$mailname || !$uid) {
$ENV{PATH} = "";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
if (!($mailname =~ /^([a-z0-9_\+\-][a-z0-9_\+\.\-]+\_[a-z0-9\.-]+)$/)) {
die "Email is incorrect.";
}
$mailname=$1;
if (!($uid =~ /^([0-9]+)$/)) {
die "uid is incorrect.";
sub escapeshellarg {
my ($st) = @_;
$st =~ s/\'/\'\\\'\'/;
return "'".$st."'";
}
$uid=$1;
$< = $>;
$( = $);
my $PTH="/var/alternc/mail/".substr($mailname,0,1)."/".$mailname;
my @todo=(
$PTH,
$PTH."/Maildir",
$PTH."/Maildir/cur",
$PTH."/Maildir/new",
$PTH."/Maildir/tmp",
);
foreach(@todo) {
mkdir($_);
chown(33, $uid, $_);
}
exec($M_PATH." ".escapeshellarg($mailname)." ".escapeshellarg($uid));
0;
......@@ -4,6 +4,8 @@ use strict;
my ($mailname) = @ARGV;
my $M_PATH = "/usr/bin/ssh -i /etc/alternc/ssh/id_rsa-maildel -F /etc/alternc/ssh/ssh_config lucie.domainepublic.lan /usr/local/lib/alternc/mail_del";
if (!$mailname) {
print "Usage: mail_del <mailname>\n";
print " Destroy pop account <mailname>\n";
......@@ -13,15 +15,12 @@ if (!$mailname) {
$ENV{PATH} = "";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
if (!($mailname =~ /^([a-z0-9_\+-][a-z0-9_\+\.-]+\_[a-z0-9\.-]+)$/)) {
die "Email is incorrect.";
sub escapeshellarg {
my ($st) = @_;
$st =~ s/\'/\'\\\'\'/;
return "'".$st."'";
}
$mailname=$1;
$< = $>;
$( = $);
system("/bin/rm -rf '/var/alternc/mail/".substr($mailname,0,1)."/".$mailname."'");
exec($M_PATH." ".escapeshellarg($mailname));
0;
......@@ -31,7 +31,7 @@
require("/var/alternc/bureau/class/local.php");
$FILES_OWNER = 33;
$APACHE_LOG = '/var/log/apache/access.log.1';
$APACHE_LOG = '/var/log/apache2/access.log.1';
umask(0177);
$hosts = array();
$nolog_hosts = array();
......
......@@ -5,15 +5,6 @@ require_once("/var/alternc/bureau/class/config_nochk.php");
// On dverrouile le bureau AlternC :)
alternc_shutdown();
echo "---------------------------\n Generating size-cache for mail accounts\n\n";
$r=mysql_query("SELECT * FROM mail_users WHERE alias NOT LIKE '%@%' AND alias LIKE '%\_%';");
while ($c=mysql_fetch_array($r)) {
echo $c["alias"]; flush();
$size=exec("/usr/lib/alternc/du.pl ".$c["path"]);
mysql_query("REPLACE INTO size_mail SET alias='".addslashes($c["alias"])."',size='$size';");
echo " done ($size KB)\n"; flush();
}
echo "---------------------------\n Generating size-cache for web accounts\n\n";
$r=mysql_query("SELECT uid,login FROM membres;");
while ($c=mysql_fetch_array($r)) {
......
......@@ -158,7 +158,7 @@ function dobck() {
if [ -e "${target_dir}/${db}.sql.${next_i}${ext}" ]; then
mv -f "${target_dir}/${db}.sql.${next_i}${ext}" \
"${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null
"${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null || true
fi
i=$next_i # loop should end here
done
......@@ -166,7 +166,7 @@ function dobck() {
# move most recently backup with a rotate file name
if [ -e "${target_dir}/${db}.sql${ext}" ]; then
mv -f "${target_dir}/${db}.sql${ext}" \
"${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null
"${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null || true
fi
name_backup_file="${db}"
......@@ -192,7 +192,7 @@ function dobck() {
# -exec rm -f {} \; : remove all files found
#
debug "find ${target_dir} -name \"${db}.*sql${ext}\" -maxdepth 1 -mtime +$last2del -exec rm -f {} \; -ls"
find ${target_dir} -name "${db}.*sql${ext}" -maxdepth 1 -mtime +${last2del} -exec rm -f {} \; -ls
find ${target_dir} -name "${db}.*sql${ext}" -maxdepth 1 -mtime +${last2del} -exec rm -f {} \; -ls || true
# set the name of the backup file with the date of the day
name_backup_file="${db}.${DATE}"
......@@ -245,10 +245,12 @@ function dobck() {
if [ "$DO_BACKUP" == "YES" ]; then
command="mysqldump --defaults-file=/etc/alternc/my.cnf --add-drop-table --allow-keywords --quote-names --force --quick --add-locks --lock-tables --extended-insert $db"
if [ "$compressed" -eq 1 ] ; then
$command = "$command | gzip -c"
debug "$command > ${target_dir}/${name_backup_file}.sql${ext}"
$command | gzip -c > "${target_dir}/${name_backup_file}.sql${ext}" || echo "backup failed for ${name_backup_file}"
else
debug "$command > ${target_dir}/${name_backup_file}.sql${ext}"
$command > "${target_dir}/${name_backup_file}.sql${ext}" || echo "backup failed for ${name_backup_file}"
fi
debug "$command > ${target_dir}/${name_backup_file}.sql${ext}"
$command > "${target_dir}/${name_backup_file}.sql${ext}"
fi
IFS=" "
......@@ -270,6 +272,7 @@ read_parameters() {
-t|--type) shift; TYPE="$1";;
-n|--name-methode) shift; SQLBACKUP_TYPE="$1";;
-a|--allow-ovewrite) shift; SQLBACKUP_OVERWRITE="$1" ;;
daily|weekly) TYPE="$1";; # backwards compatibility
*)
error "invalid option -- $1"
error "Try \`sqlbackup.sh --help' for more information."
......
......@@ -34,7 +34,7 @@ ALTERNC_ROOT=/var/alternc
ALTERNC_ETC=/etc/alternc
ALTERNC_LIB=/usr/lib/alternc
ALTERNC_CONF_FILE=$ALTERNC_ETC/local.sh
LOG_DIR=/var/log/apache
LOG_DIR=/var/log/apache2
TMP_ROOT=$ALTERNC_ROOT/tmp
RES_FILE=$TMP_ROOT/$PROG_NAME.res.$$
INTERMEDIATE_FILE=$TMP_ROOT/$PROG_NAME.int.$$
......
......@@ -34,7 +34,7 @@ ALTERNC_ROOT=/var/alternc
ALTERNC_ETC=/etc/alternc
ALTERNC_LIB=/usr/lib/alternc
ALTERNC_CONF_FILE=$ALTERNC_ETC/local.sh
LOG_DIR=/var/log
LOG_DIR=/var/log/mysql
LOG_FILE=$LOG_DIR/mysql.log
TMP_ROOT=$ALTERNC_ROOT/tmp
RES_FILE=$TMP_ROOT/$PROG_NAME.res.$$
......