...
 
Commits (53)
......@@ -34,14 +34,14 @@ include("head.php");
</head>
<body>
<h3>Ce bureau est un lieu de dveloppement pour arranger minimalement alterc dans l'objectif d'y faire un "theme" plus joli et personnalisable</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 &agrave; %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"]);
......@@ -49,6 +49,8 @@ if ($mem->user["lastfail"]) {
$mem->resetlast();
echo "<h2>Derni&egrave;res nouvelles de chez DomainePublic</h2>";
# use MagpieRSS to syndicate content from another site if available
# this should work, since the debian package installs it in
......@@ -59,13 +61,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,13 +34,15 @@ 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");
......
......@@ -38,7 +38,10 @@ if ($mem->checkRight())
<dt id="reseller">Reseller</dt>
<dd><a href="adm_list.php"><?php __("Manage the members"); ?></a></dd>
<dd><a href="adm_panel.php"><?php __("Admin Control Panel"); ?></a></dd>
<dd><a href="/admin/sql/?server=2"><?php __("General SQL Admin"); ?></a></dd>
<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
}
?>
......@@ -30,4 +30,4 @@
?>
<dt id="help"><?php __("Online help"); ?></dt>
<dd><a href="http://doc.alternc.org/user/" target="help"><?php __("Online help"); ?></a></dd>
<dd><a href="http://www.aide-alternc.org/" target="help"><?php __("Online help"); ?></a></dd>
......@@ -30,5 +30,7 @@
/* ############# BROUTEUR ############# */
?>
<dt id="browser"><?php __("File browser"); ?></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,7 +30,7 @@
$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 target="_blank" href="sql_admin.php"><?php __("SQL Admin"); ?></a></dd>
......
<?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>
......@@ -35,7 +35,7 @@ if (!$r=$mysql->get_dblist()) {
} else {
setcookie("REMOTE_USER",$r[0]["login"]);
setcookie("REMOTE_PASSWORD",$r[0]["pass"]);
if ($lang) $l="&lang=".substr($lang,0,2);
if ($lang) $l="&lang=".substr($lang,0,2).'-utf-8';
// TODO : make it an absolute url ! (even in httpS :))
header("Location: /admin/sql/index.php?server=1$l");
exit();
......
......@@ -138,19 +138,19 @@ body#menu h3 {
padding:0;
margin:0;
font-size: 1em;
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
header ("Location: /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;
......
......@@ -26,6 +26,7 @@ $locales = update_locale($langpath);
if (!(isset($lang))) { // Use the browser first preferred language
$lang=strtolower(substr(trim($_SERVER["HTTP_ACCEPT_LANGUAGE"]),0,5));
$lang=substr(trim($_SERVER["HTTP_ACCEPT_LANGUAGE"]),0,5);
}
......@@ -40,7 +41,7 @@ if (!$locales[$lang]) { // Requested language not found in locales
}
}
if (!isset($locales[$lang])) $lang=$locales[0];
if (!isset($locales[$lang])) $lang=$locales['fr_BE'];
if (isset($setlang) && isset($lang)) {
setcookie("lang",$lang);
......
<?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
......@@ -304,7 +304,7 @@ class m_dom {
switch($ext) {
case "com":
case "net":
$serveur="rs.internic.net";
$serveur="whois.crsnic.net";
$egal="=";
break;
case "org":
......@@ -313,8 +313,13 @@ class m_dom {
case "be":
$serveur="whois.dns.be";
break;
case "brussels":
$serveur="whois.nic.brussels";
break;
case "coop":
$serveur="whois.domains.coop";
case "eu":
$serveur="195.234.53.193";
$serveur="whois.eu";
break;
case "info":
$serveur="whois.afilias.net";
......@@ -338,9 +343,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 "kitchen":
$serveur="whois.donuts.co";
break;
default:
$err->raise("dom",7);
return false;
......@@ -362,6 +373,8 @@ class m_dom {
case "net":
case "info":
case "biz":
case "in":
case "brussels":
case "name":
if (ereg("Name Server:", $ligne)) {
$found = true;
......@@ -431,6 +444,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
......
......@@ -1240,11 +1240,11 @@ msgstr "Ajout d'un mail sur le domaine %s"
#: ../admin/mail_add.php:49 ../admin/mail_edit.php:58
msgid "Is it a POP account?"
msgstr "Compte POP ?"
msgstr "Compte POP/IMAP ?"
#: ../admin/mail_add.php:50 ../admin/mail_edit.php:59
msgid "POP password"
msgstr "Mot de passe POP"
msgstr "Mot de passe POP/IMAP"
#: ../admin/mail_add.php:52 ../admin/mail_edit.php:61
msgid "Other recipients"
......@@ -2323,11 +2323,11 @@ msgstr "Les modifications seront prises en comptes dans 5 minutes."
#: ../admin/mail_edit.php:58
msgid "WARNING: turning POP off will DELETE the mailbox and its content"
msgstr ""
msgstr "ATTENTION: la suppression de POP/IMAP SUPPRIMERA la boite et son contenu"
#: ../admin/main.php:62
msgid "Latest news"
msgstr ""
msgstr "Actualit"
#~ msgid "Create the domain username."
#~ msgstr "Installer le domaine login."
......
......@@ -2181,4 +2181,4 @@ msgstr ""
#: ../admin/main.php:62
msgid "Latest news"
msgstr ""
msgstr "Latest news from DomainePublic"
......@@ -33,6 +33,8 @@ ALTERNC_LOC=/var/alternc
NS1_HOSTNAME="$FQDN"
NS2_HOSTNAME="$FQDN"
HOSTING="AlternC"
SQLBACKUP_TYPE="rotate"
SQLBACKUP_OVERWRITE="no"
if [ -r /etc/alternc/local.sh ]; then
# source the current config
......@@ -134,6 +136,18 @@ if [ -z "$RET" ]
db_set alternc/mysql/client "$MYSQL_CLIENT"
fi
db_get alternc/sql/backup_type
if [ -z "$RET" ]
then
db_set alternc/sql/backup_type "$SQLBACKUP_TYPE"
fi
db_get alternc/sql/backup_overwrite
if [ -z "$RET" ]
then
db_set alternc/sql/backup_overwrite "$SQLBACKUP_OVERWRITE"
fi
db_get alternc/alternc_location
if [ -z "$RET" ]
then
......
......@@ -93,6 +93,13 @@ ALTERNC_LOC=""
# Networks that SMTP should relay, separated with spaces
SMTP_RELAY_NETWORKS=""
# the type of backup created by the sql backup script
# valid options are "rotate" (newsyslog-style) or "date" (suffix is the date)
SQLBACKUP_TYPE=""
# overwrite existing files when backing up
SQLBACKUP_OVERWRITE=""
EOF
chown root:www-data $CONFIGFILE
......@@ -117,6 +124,8 @@ EOF
update_var alternc/bind_internal BIND_INTERNAL
update_var alternc/default_mx DEFAULT_MX
update_var alternc/mysql/client MYSQL_CLIENT
update_var alternc/sql/backup_type SQLBACKUP_TYPE
update_var alternc/sql/backup_overwrite SQLBACKUP_OVERWRITE
update_var alternc/alternc_location ALTERNC_LOC
update_var alternc/mynetwork SMTP_RELAY_NETWORKS
sed -e "$SED_SCRIPT" < $CONFIGFILE > $CONFIGFILE.tmp
......
<?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%%.
......
......@@ -113,7 +113,7 @@ EOF
fi
# create a sed script to create/update the file
function set_value() {
set_value() {
var=$1
RET=$2
grep -Eq "^ *$var=" $MYSQL_CONFIG || echo "$var=" >> $MYSQL_CONFIG
......
......@@ -47,7 +47,7 @@ fi
. "$CONFIG_FILE"
function doone {
doone() {
read GID LOGIN
while [ "$LOGIN" ]
do
......
......@@ -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)) {
......
This diff is collapsed.
......@@ -243,7 +243,7 @@ if [ ! -z "$RELOAD_ZONES" ]; then
rndc reload "$zone" > /dev/null || echo "Cannot reload bind for zone $zone" >> "$DOMAIN_LOG_FILE"
done
fi
apachectl graceful > /dev/null || echo "Cannot restart apache" >> "$DOMAIN_LOG_FILE"
apache2ctl graceful > /dev/null || echo "Cannot restart apache" >> "$DOMAIN_LOG_FILE"
fi
# Cleanup
......
......@@ -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.$$
......