Merging 'feature-message' into main stable branch. Thanks Quenenni !
This commit is contained in:
commit
21511e5385
|
@ -30,7 +30,7 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (!$id && !$quota->cancreate("aws")) {
|
||||
$error=_("You cannot add any new statistics, your quota is over.");
|
||||
$msg->raise('Alert', "aws", _("You cannot add any new statistics, your quota is over."));
|
||||
}
|
||||
|
||||
include_once("head.php");
|
||||
|
@ -42,9 +42,7 @@ include_once("head.php");
|
|||
<br/>
|
||||
<br/>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"error\">$error</p></body></html>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<form method="post" action="<?php if (!$id) echo "aws_doadd.php"; else echo "aws_doedit.php"; ?>" id="main" name="main">
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
*/
|
||||
require_once("../class/config.php");
|
||||
|
||||
$error="";
|
||||
// On parcours les POST_VARS et on repere les del_.
|
||||
reset($_POST);
|
||||
$found=false;
|
||||
|
@ -33,16 +32,14 @@ while (list($key,$val)=each($_POST)) {
|
|||
// Effacement du jeu de stats $val
|
||||
$r=$aws->delete_stats($val);
|
||||
$found=true;
|
||||
if (!$r) {
|
||||
$error.=$err->errstr()."<br />";
|
||||
} else {
|
||||
$error.=sprintf(_("The statistics %s has been successfully deleted"),$r)."<br />";
|
||||
if ($r) {
|
||||
$msg->raise('Ok', "aws", _("The statistics %s has been successfully deleted"),$r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$error.=_("Please check the statistics set you want to delete");
|
||||
$msg->raise('Info', "aws", _("Please check the statistics set you want to delete"));
|
||||
}
|
||||
|
||||
include("aws_list.php");
|
||||
|
|
|
@ -34,17 +34,15 @@ getFields($fields);
|
|||
if ($aws->check_host_available($hostname)) {
|
||||
$r=$aws->add_stats($hostname,$awsusers,$hostaliases,1);
|
||||
if (!$r) {
|
||||
$error=$err->errstr();
|
||||
include("aws_add.php");
|
||||
exit();
|
||||
} else {
|
||||
$error=_("The statistics has been successfully created");
|
||||
$msg->raise('Ok', "aws", _("The statistics has been successfully created"));
|
||||
include("aws_list.php");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$error=$err->errstr();
|
||||
include("aws_add.php");
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (!$id) {
|
||||
$error=_("No Statistics selected!");
|
||||
$msg->raise('Error', "aws", _("No Statistics selected!"));
|
||||
} else {
|
||||
$ha ="";
|
||||
foreach($hostaliases as $ho)
|
||||
|
@ -41,11 +41,10 @@ if (!$id) {
|
|||
|
||||
$r=$aws->put_stats_details($id,$awsusers,$ha,$public);
|
||||
if (!$r) {
|
||||
$error=$err->errstr();
|
||||
include("aws_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
$error=_("The Statistics has been successfully changed");
|
||||
$msg->raise('Ok', "aws", _("The Statistics has been successfully changed"));
|
||||
include("aws_list.php");
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -30,12 +30,10 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (!$id) {
|
||||
$error=_("No Statistics selected!");
|
||||
$msg->raise('Error', "aws", _("No Statistics selected!"));
|
||||
} else {
|
||||
$r=$aws->get_stats_details($id);
|
||||
if (!$r) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
if ($r) {
|
||||
$id=$r["id"];
|
||||
$hostname=$r["hostname"];
|
||||
$awsusers=$r["users"];
|
||||
|
|
|
@ -24,28 +24,35 @@
|
|||
*/
|
||||
require_once("../class/config.php");
|
||||
include_once("head.php");
|
||||
|
||||
$nosta=false;
|
||||
if (!$r=$aws->get_list()) {
|
||||
$msg->raise('Info', "aws", _("No statistics currently defined"));
|
||||
$nosta=true;
|
||||
}
|
||||
|
||||
$create=true;
|
||||
if (!$quota->cancreate("aws")) {
|
||||
$msg->raise('Info', "aws", _("Your stat quota is over..."));
|
||||
$create=false;
|
||||
}
|
||||
?>
|
||||
|
||||
<h3><?php __("Statistics List"); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php if (!empty($error)) { echo "<p class=\"error\">$error</p>"; $error=''; } ?>
|
||||
<?php
|
||||
echo $msg->msg_html_all("<li>", true, true);
|
||||
?>
|
||||
<p>
|
||||
<?php
|
||||
|
||||
$nosta=false;
|
||||
if (!$r=$aws->get_list()) {
|
||||
$error=$err->errstr();
|
||||
$nosta=true;
|
||||
}
|
||||
|
||||
if (!empty($error)) { echo "<p class=\"error\">$error</p>"; $error=''; }
|
||||
//echo "<pre>";print_r($mem);echo "</pre>";
|
||||
?>
|
||||
|
||||
<span class="ina"><a href="aws_users.php"><?php __("Manage allowed users' accounts"); ?></a></span><br /><br />
|
||||
|
||||
<?php
|
||||
if ($quota->cancreate("aws")) { ?>
|
||||
if ($create) { ?>
|
||||
<span class="ina"><a href="aws_add.php"><?php __("Create new Statistics"); ?></a></span><br />
|
||||
<?php } // cancreate ?>
|
||||
</p>
|
||||
|
|
|
@ -26,28 +26,26 @@ require_once("../class/config.php");
|
|||
|
||||
$fields = array (
|
||||
"login" => array ("request", "string", ""),
|
||||
"pass" => array ("request", "string", ""),
|
||||
"passconf" => array ("request", "string", ""),
|
||||
"pass" => array ("post", "string", ""),
|
||||
"passconf" => array ("post", "string", ""),
|
||||
"confirm" => array ("post", "string", ""),
|
||||
);
|
||||
|
||||
getFields($fields);
|
||||
|
||||
if (!$aws->login_exists($login)) {
|
||||
$error=$err->errstr();
|
||||
include("aws_users.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($pass) {
|
||||
if ($pass != $passconf) {
|
||||
$error = _("Passwords do not match");
|
||||
include("aws_users.php");
|
||||
exit();
|
||||
}else{
|
||||
if (!$aws->change_pass($login,$pass)) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
$error = _("Password successfuly updated");
|
||||
if ($confirm == 1) {
|
||||
if (empty($pass) || is_null($pass)) {
|
||||
$msg->raise('Error', "aws", _("Please enter a password"));
|
||||
} else if ($pass != $passconf) {
|
||||
$msg->raise('Error', "aws", _("Passwords do not match"));
|
||||
} else {
|
||||
if ($aws->change_pass($login,$pass)) {
|
||||
$msg->raise('Ok', "aws", _("Password successfuly updated"));
|
||||
include("aws_users.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -56,22 +54,24 @@ if ($pass) {
|
|||
|
||||
include_once("head.php");
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['aws']['classcount'];
|
||||
|
||||
?>
|
||||
<h3><?php __("Change a user's password"); ?></h3>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<p class="error"><?php echo $error ; $error=''; ?></p>
|
||||
<?php } ?>
|
||||
|
||||
<form method="post" action="aws_pass.php" name="main" id="main">
|
||||
<?php csrf_get(); ?>
|
||||
<input type="hidden" name="confirm" value="1" />
|
||||
<table class="tedit">
|
||||
<tr><th>
|
||||
<?php __("Username"); ?></th><td>
|
||||
<code><?php echo $login; ?></code> <input type="hidden" name="login" value="<?php echo $login; ?>" />
|
||||
</td></tr>
|
||||
<tr><th><label for="pass"><?php __("New Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td></tr>
|
||||
<tr><th><label for="pass"><?php __("New Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="<?php echo $pass; ?>" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf",$passwd_classcount); ?></td></tr>
|
||||
<tr><th><label for="passconf"><?php __("Confirm password"); ?></label></th><td><input type="password" class="int" name="passconf" id="passconf" value="" size="20" maxlength="64" /></td></tr>
|
||||
<tr class="trbtn"><td colspan="2">
|
||||
<input type="submit" class="inb" name="submit" value="<?php __("Change this user's password"); ?>" />
|
||||
|
|
|
@ -33,14 +33,12 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if ($pass != $passconf) {
|
||||
$error = _("Passwords do not match");
|
||||
$msg->raise('Error', "aws", _("Passwords do not match"));
|
||||
}else{
|
||||
$r=$aws->add_login($prefixe.(($login)?"_":"").$login,$pass);
|
||||
|
||||
if (!$r) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
$error=_("The Awstat account has been successfully created");
|
||||
if ($r) {
|
||||
$msg->raise('Ok', "aws", _("The Awstat account has been successfully created"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,17 +24,14 @@
|
|||
*/
|
||||
require_once("../class/config.php");
|
||||
|
||||
$error="";
|
||||
// On parcours les POST_VARS et on repere les del_.
|
||||
reset($_POST);
|
||||
while (list($key,$val)=each($_POST)) {
|
||||
if (substr($key,0,4)=="del_") {
|
||||
// Effacement du compte ftp $val
|
||||
$r=$aws->del_login($val);
|
||||
if (!$r) {
|
||||
$error.=$err->errstr()."<br />";
|
||||
} else {
|
||||
$error.=sprintf(_("The awstat account %s has been successfully deleted"),$val)."<br />";
|
||||
if ($r) {
|
||||
$msg->raise('Ok', "aws", _("The awstat account %s has been successfully deleted"),$val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,17 +30,16 @@ include_once("head.php");
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
|
||||
if (isset($error) && $error) { ?>
|
||||
<p class="error"><?php echo $error; $error=''; ?></p>
|
||||
<?php }
|
||||
|
||||
$nologin=false;
|
||||
if (!$r=$aws->list_login()) {
|
||||
$nologin=true;
|
||||
$error=$err->errstr();
|
||||
}
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['aws']['classcount'];
|
||||
|
||||
if ($quota->cancreate("aws")) { ?>
|
||||
<p><span class="ina"><a href="aws_add.php"><?php __("Create new Statistics"); ?></a></span></p>
|
||||
<?php } ?>
|
||||
|
@ -52,7 +51,7 @@ if (!$r=$aws->list_login()) {
|
|||
<label for="login"><?php __("Username"); ?></label></th><td>
|
||||
<select class="inl" name="prefixe"><?php $aws->select_prefix_list($prefixe); ?></select> <b>_</b> <input type="text" class="int" name="login" id="login" value="" size="20" maxlength="64" />
|
||||
</td></tr>
|
||||
<tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td></tr>
|
||||
<tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf",$passwd_classcount); ?></td></tr>
|
||||
<tr><th><label for="passconf"><?php __("Confirm password"); ?></label></th><td><input type="password" class="int" name="passconf" id="passconf" value="" size="20" maxlength="64" /></td></tr>
|
||||
<tr class="trbtn"><td colspan="2">
|
||||
<input type="submit" class="inb" name="submit" value="<?php __("Create this new Awstats user"); ?>" />
|
||||
|
@ -62,14 +61,8 @@ if (!$r=$aws->list_login()) {
|
|||
</table>
|
||||
</form>
|
||||
<br />
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
if (isset($error) && $error) {
|
||||
?>
|
||||
<p class="error"><?php echo $error ?></p>
|
||||
<?php }
|
||||
|
||||
if (!$nologin) {
|
||||
?>
|
||||
|
||||
|
|
|
@ -94,8 +94,8 @@ class m_aws {
|
|||
* $r[0-n]["users"]= list of allowed users separated with ' '
|
||||
*/
|
||||
function get_list() {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","get_list");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","get_list");
|
||||
$r=array();
|
||||
$db->query("SELECT id, hostname FROM aws WHERE uid='$cuid' ORDER BY hostname;");
|
||||
if ($db->num_rows()) {
|
||||
|
@ -120,7 +120,6 @@ class m_aws {
|
|||
}
|
||||
return $t;
|
||||
} else {
|
||||
$err->raise("aws",_("No statistics currently defined"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -137,8 +136,8 @@ class m_aws {
|
|||
* $r["users"] = List of allowed users, separated by ' '
|
||||
*/
|
||||
function get_stats_details($id) {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","get_stats_details",$id);
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","get_stats_details",$id);
|
||||
$db->query("SELECT id, hostname, hostaliases, public FROM aws WHERE uid='$cuid' AND id='$id';");
|
||||
if ($db->num_rows()) {
|
||||
$db->next_record();
|
||||
|
@ -159,7 +158,7 @@ class m_aws {
|
|||
"public"=>$public
|
||||
);
|
||||
} else {
|
||||
$err->raise("aws",_("This statistic does not exist"));
|
||||
$msg->raise('Error', "aws",_("This statistic does not exist"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +170,7 @@ class m_aws {
|
|||
* @return array an array of allowed domains / subdomains.
|
||||
*/
|
||||
function host_list() {
|
||||
global $db,$err,$cuid;
|
||||
global $db,$msg,$cuid;
|
||||
$r=array();
|
||||
$db->query("SELECT sd.domaine, sd.sub, dt.name, dt.description FROM sub_domaines sd, domaines_type dt WHERE compte='$cuid' AND lower(sd.type) = lower(dt.name) AND dt.only_dns = false ORDER BY domaine,sub;");
|
||||
while ($db->next_record()) {
|
||||
|
@ -252,14 +251,14 @@ class m_aws {
|
|||
* of available for this member.
|
||||
*/
|
||||
function check_host_available($current) {
|
||||
global $err;
|
||||
$err->log("aws","check_host_available",$current);
|
||||
global $msg;
|
||||
$msg->log("aws","check_host_available",$current);
|
||||
$r=$this->get_list();
|
||||
if(is_array($r)){
|
||||
reset($r);
|
||||
while (list($key,$val)=each($r)) {
|
||||
if ($current==$val["hostname"]) {
|
||||
$err->raise("aws",_("Host already managed by awstats!"));
|
||||
$msg->raise('Alert', "aws",_("Host already managed by awstats!"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +272,7 @@ class m_aws {
|
|||
* Return the hostaliases list with an id.
|
||||
*/
|
||||
function get_hostaliases($id) {
|
||||
global $db,$err,$cuid;
|
||||
global $db,$msg,$cuid;
|
||||
$r=array();
|
||||
if ($id == NULL)
|
||||
return $r;
|
||||
|
@ -293,7 +292,7 @@ class m_aws {
|
|||
* @param array $users the list of allowed users
|
||||
*/
|
||||
function put_stats_details($id,$users,$hostaliases,$public) {
|
||||
global $err,$db,$cuid;
|
||||
global $msg,$db,$cuid;
|
||||
if ($this->get_stats_details($id)) {
|
||||
$this->delete_allowed_login($id, 1);
|
||||
if (is_array($users)) {
|
||||
|
@ -318,11 +317,11 @@ class m_aws {
|
|||
* @return string the domain name of the deleted statistic set, or FALSE if an error occurred
|
||||
*/
|
||||
function delete_stats($id) {
|
||||
global $db,$err,$cuid,$action;
|
||||
$err->log("aws","delete_stats",$id);
|
||||
global $db,$msg,$cuid,$action;
|
||||
$msg->log("aws","delete_stats",$id);
|
||||
$db->query("SELECT hostname FROM aws WHERE id='$id' and uid='$cuid';");
|
||||
if (!$db->num_rows()) {
|
||||
$err->raise("aws",_("This statistic does not exist"));
|
||||
$msg->raise('Error', "aws",_("This statistic does not exist"));
|
||||
return false;
|
||||
}
|
||||
$db->next_record();
|
||||
|
@ -346,8 +345,8 @@ class m_aws {
|
|||
* @return boolean TRUE if the set has been created
|
||||
*/
|
||||
function add_stats($hostname,$users="", $hostaliases,$public) {
|
||||
global $db,$err,$quota,$mem,$cuid;
|
||||
$err->log("aws","add_stats",$hostname);
|
||||
global $db,$msg,$quota,$mem,$cuid;
|
||||
$msg->log("aws","add_stats",$hostname);
|
||||
$ha="";
|
||||
$r=$this->host_list();
|
||||
$hosts=array();
|
||||
|
@ -356,7 +355,7 @@ class m_aws {
|
|||
}
|
||||
reset($hosts);
|
||||
if (!in_array($hostname,$hosts) || $hostname=="") {
|
||||
$err->raise("aws",_("This hostname does not exist (Domain name)"));
|
||||
$msg->raise('Error', "aws",_("This hostname does not exist (Domain name)"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -364,7 +363,7 @@ class m_aws {
|
|||
if (is_array($hostaliases)) {
|
||||
foreach($hostaliases as $ho) {
|
||||
if (!in_array($ho,$hosts) || $hostname=="") {
|
||||
$err->raise("aws",_("This hostname does not exist (Hostaliases)"));
|
||||
$msg->raise('Error', "aws",_("This hostname does not exist (Hostaliases)"));
|
||||
return false;
|
||||
}
|
||||
$ha .= "$ho ";
|
||||
|
@ -384,7 +383,7 @@ class m_aws {
|
|||
mkdir($this->CACHEDIR."/".$hostname,0777);
|
||||
return true;
|
||||
} else {
|
||||
$err->raise("aws",_("Your stat quota is over..."));
|
||||
$msg->raise('Alert', "aws",_("Your stat quota is over..."));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -392,12 +391,12 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function list_login() {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","list_login");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","list_login");
|
||||
$db->query("SELECT login FROM aws_users WHERE uid='$cuid';");
|
||||
$res=array();
|
||||
if (!$db->next_record()) {
|
||||
$err->raise("aws",_("No user currently defined"));
|
||||
$msg->raise('Info', "aws",_("No user currently defined"));
|
||||
return false;
|
||||
}
|
||||
do {
|
||||
|
@ -409,8 +408,8 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function list_allowed_login($id) {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","list_allowed_login");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","list_allowed_login");
|
||||
$db->query("SELECT u.login,a.id FROM aws_users u LEFT JOIN aws_access a ON a.id='$id' AND a.login=u.login WHERE u.uid='$cuid';");
|
||||
$res=array();
|
||||
if (!$db->next_record()) {
|
||||
|
@ -424,7 +423,7 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function get_view_public($id) {
|
||||
global $db,$err,$cuid;
|
||||
global $db,$msg,$cuid;
|
||||
$db->query("SELECT public FROM aws WHERE id='$id' and uid='$cuid';");
|
||||
if ($db->num_rows()) {
|
||||
$db->next_record();
|
||||
|
@ -439,8 +438,8 @@ class m_aws {
|
|||
/* ----------------------------------------------------------------- */
|
||||
/* Check that a login exists ($exists=1) or doesn't exist ($exists=0) */
|
||||
function login_exists($login,$exists=1) {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","list_login");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","list_login");
|
||||
$db->query("SELECT login FROM aws_users WHERE uid='$cuid' AND login='$login';");
|
||||
if (!$db->next_record()) {
|
||||
return ($exists==0);
|
||||
|
@ -452,10 +451,10 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function del_login($login) {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","del_login");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","del_login");
|
||||
if (!$this->login_exists($login,1)) {
|
||||
$err->raise("aws",_("Login does not exist"));
|
||||
$msg->raise('Error', "aws",_("Login does not exist"));
|
||||
return false;
|
||||
}
|
||||
$db->query("DELETE FROM aws_users WHERE uid='$cuid' AND login='$login';");
|
||||
|
@ -467,17 +466,22 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function add_login($login,$pass) {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","add_login");
|
||||
global $db,$msg,$cuid,$admin;
|
||||
$msg->log("aws","add_login");
|
||||
|
||||
if (!($login=$this->_check($login))) {
|
||||
$err->raise("aws",_("Login incorrect"));
|
||||
return false;
|
||||
}
|
||||
if ($this->login_exists($login,1)) {
|
||||
$err->raise("aws",_("Login already exist"));
|
||||
$msg->raise('Error', "aws",_("Login already exist"));
|
||||
return false;
|
||||
}
|
||||
// Check this password against the password policy using common API :
|
||||
if (is_callable(array($admin, "checkPolicy"))) {
|
||||
if (!$admin->checkPolicy("aws", $login, $pass)) {
|
||||
return false; // The error has been raised by checkPolicy()
|
||||
}
|
||||
}
|
||||
$pass=$this->crypt_apr1_md5($pass);
|
||||
// FIXME retourner une erreur l'insert se passe pas bien
|
||||
$db->query("INSERT INTO aws_users (uid,login,pass) VALUES ('$cuid','$login','$pass');");
|
||||
|
@ -487,17 +491,23 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function change_pass($login,$pass) {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","change_pass");
|
||||
global $db,$msg,$cuid,$admin;
|
||||
$msg->log("aws","change_pass");
|
||||
|
||||
if (!($login=$this->_check($login))) {
|
||||
$err->raise("aws",_("Login incorrect")); // Login incorrect
|
||||
$msg->raise('Error', "aws",_("Login incorrect")); // Login incorrect
|
||||
return false;
|
||||
}
|
||||
if (!($this->login_exists($login))) {
|
||||
$err->raise("aws",_("Login does not exists")); // Login does not exists
|
||||
$msg->raise('Error', "aws",_("Login does not exists")); // Login does not exists
|
||||
return false;
|
||||
}
|
||||
// Check this password against the password policy using common API :
|
||||
if (is_callable(array($admin, "checkPolicy"))) {
|
||||
if (!$admin->checkPolicy("aws", $login, $pass)) {
|
||||
return false; // The error has been raised by checkPolicy()
|
||||
}
|
||||
}
|
||||
$pass=$this->crypt_apr1_md5($pass);
|
||||
$db->query("UPDATE aws_users SET pass='$pass' WHERE login='$login';");
|
||||
return $this->_createhtpasswd();
|
||||
|
@ -506,25 +516,25 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function allow_login($login,$id,$noconf=0) { // allow user $login to access stats $id.
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","allow_login");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","allow_login");
|
||||
|
||||
if (!($login=$this->_check($login))) {
|
||||
$err->raise("aws",_("Login incorrect"));
|
||||
$msg->raise('Error', "aws",_("Login incorrect"));
|
||||
return false;
|
||||
}
|
||||
if (!$this->login_exists($login)) {
|
||||
$err->raise("aws",_("Login does not exist"));
|
||||
$msg->raise('Error', "aws",_("Login does not exist"));
|
||||
return false;
|
||||
}
|
||||
$db->query("SELECT id FROM aws WHERE id='$id' AND uid='$cuid'");
|
||||
if (!$db->next_record()) {
|
||||
$err->raise("aws",_("The requested statistic does not exist."));
|
||||
$msg->raise('Error', "aws",_("The requested statistic does not exist."));
|
||||
return false;
|
||||
}
|
||||
$db->query("SELECT login FROM aws_access WHERE id='$id' AND login='$login'");
|
||||
if ($db->next_record()) {
|
||||
$err->raise("aws",_("This login is already allowed for this statistics."));
|
||||
$msg->raise('Error', "aws",_("This login is already allowed for this statistics."));
|
||||
return false;
|
||||
}
|
||||
$db->query("INSERT INTO aws_access (uid,id,login) VALUES ('$cuid','$id','$login');");
|
||||
|
@ -542,12 +552,12 @@ class m_aws {
|
|||
* @param integer $id
|
||||
*/
|
||||
function delete_allowed_login($id,$noconf=0) {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","delete_allowed_login");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","delete_allowed_login");
|
||||
|
||||
$db->query("SELECT id FROM aws WHERE id='$id' AND uid='$cuid'");
|
||||
if (!$db->next_record()) {
|
||||
$err->raise("aws",_("The requested statistic does not exist."));
|
||||
$msg->raise('Error', "aws",_("The requested statistic does not exist."));
|
||||
return false;
|
||||
}
|
||||
$db->query("DELETE FROM aws_access WHERE id='$id';");
|
||||
|
@ -561,25 +571,25 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function deny_login($login,$id,$noconf=0) { // deny user $login to access stats $id.
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","deny_login");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","deny_login");
|
||||
|
||||
if (!($login=$this->_check($login))) {
|
||||
$err->raise("aws",_("Login incorrect")); // Login incorrect
|
||||
$msg->raise('Error', "aws",_("Login incorrect")); // Login incorrect
|
||||
return false;
|
||||
}
|
||||
if (!$this->login_exists($login,0)) {
|
||||
$err->raise("aws",_("Login does not exists")); // Login does not exists
|
||||
$msg->raise('Error', "aws",_("Login does not exists")); // Login does not exists
|
||||
return false;
|
||||
}
|
||||
$db->query("SELECT id FROM aws WHERE id='$id' AND uid='$cuid'");
|
||||
if (!$db->next_record()) {
|
||||
$err->raise("aws",_("The requested statistic does not exist."));
|
||||
$msg->raise('Error', "aws",_("The requested statistic does not exist."));
|
||||
return false;
|
||||
}
|
||||
$db->query("SELECT login FROM aws_access WHERE id='$id' AND login='$login'");
|
||||
if (!$db->next_record()) {
|
||||
$err->raise("aws",_("This login is already denied for this statistics."));
|
||||
$msg->raise('Error', "aws",_("This login is already denied for this statistics."));
|
||||
return false;
|
||||
}
|
||||
$db->query("DELETE FROM aws_access WHERE id='$id' AND login='$login';");
|
||||
|
@ -593,8 +603,8 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function alternc_del_member() {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","del_member");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","del_member");
|
||||
$db->query("SELECT * FROM aws WHERE uid='$cuid';");
|
||||
$t=array();
|
||||
while ($db->next_record()) {
|
||||
|
@ -616,8 +626,8 @@ class m_aws {
|
|||
* @param string $dom the domain to uninstall
|
||||
*/
|
||||
function alternc_del_domain($dom) {
|
||||
global $err,$cuid;
|
||||
$err->log("aws","alternc_del_domain",$dom);
|
||||
global $msg,$cuid;
|
||||
$msg->log("aws","alternc_del_domain",$dom);
|
||||
$db=new DB_System();
|
||||
$db->query("SELECT id,hostname FROM aws WHERE uid='$cuid' AND (hostname='$dom' OR hostname like '%.$dom')");
|
||||
$t=array();
|
||||
|
@ -639,8 +649,8 @@ class m_aws {
|
|||
* for a service
|
||||
*/
|
||||
function hook_quota_get() {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","get_quota");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","get_quota");
|
||||
$db->query("SELECT COUNT(*) AS cnt FROM aws WHERE uid='$cuid'");
|
||||
$q=Array("name"=>"aws", "description"=>_("Awstats"), "used"=>0);
|
||||
if ($db->next_record()) {
|
||||
|
@ -652,7 +662,7 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function _check($login) {
|
||||
global $err,$mem;
|
||||
global $msg,$mem;
|
||||
$login=trim($login);
|
||||
$login=strtolower($login);
|
||||
if ($c=strpos($login,"_")) {
|
||||
|
@ -664,11 +674,11 @@ class m_aws {
|
|||
}
|
||||
$r=$this->prefix_list();
|
||||
if (!in_array($prefix,$r)) {
|
||||
$err->raise("aws",_("prefix not allowed.")); // prefix not allowed.
|
||||
$msg->raise('Error', "aws",_("prefix not allowed.")); // prefix not allowed.
|
||||
return false;
|
||||
}
|
||||
if (!preg_match('/^[0-9a-z_-]*$/', $postfix)){
|
||||
$err->raise("aws",_("Forbidden caracters in the postfix."));
|
||||
$msg->raise('Error', "aws", _("There is some forbidden characters in the login (only A-Z 0-9 _ and - are allowed)"));
|
||||
return false;
|
||||
}
|
||||
return $login;
|
||||
|
@ -680,9 +690,9 @@ class m_aws {
|
|||
* @access private
|
||||
*/
|
||||
function _delconf($hostname) {
|
||||
global $err,$action;
|
||||
global $msg,$action;
|
||||
if (!preg_match('/^[._a-z0-9-]*$/', $hostname)){
|
||||
$err->raise("aws",_("Hostname is incorrect"));
|
||||
$msg->raise('Error', "aws",_("Hostname is incorrect"));
|
||||
return false;
|
||||
}
|
||||
$action->del($this->CONFDIR. DIRECTORY_SEPARATOR . "awstats.".$hostname.".conf");
|
||||
|
@ -695,10 +705,10 @@ class m_aws {
|
|||
* @access private
|
||||
*/
|
||||
function _createconf($id,$nochk=0) {
|
||||
global $db,$err,$cuid,$L_ALTERNC_LOGS;
|
||||
global $db,$msg,$cuid,$L_ALTERNC_LOGS;
|
||||
$s=@implode("",file($this->TEMPLATEFILE));
|
||||
if (!$s) {
|
||||
$err->raise("aws",_("Problem to create the configuration"));
|
||||
$msg->raise('Error', "aws",_("Problem to create the configuration"));
|
||||
return false;
|
||||
}
|
||||
if ($nochk) {
|
||||
|
@ -707,7 +717,7 @@ class m_aws {
|
|||
$db->query("SELECT * FROM aws WHERE id='$id' AND uid='$cuid';");
|
||||
}
|
||||
if (!$db->num_rows()) {
|
||||
$err->raise("aws",_("This statistic does not exist"));
|
||||
$msg->raise('Error', "aws",_("This statistic does not exist"));
|
||||
return false;
|
||||
}
|
||||
$db->next_record();
|
||||
|
@ -747,7 +757,7 @@ class m_aws {
|
|||
|
||||
/* ----------------------------------------------------------------- */
|
||||
function _createhtpasswd() {
|
||||
global $db, $err;
|
||||
global $db, $msg;
|
||||
$f=@fopen($this->HTAFILE,"wb");
|
||||
if ($f) {
|
||||
$db->query("SELECT login,pass FROM aws_users;");
|
||||
|
@ -757,7 +767,7 @@ class m_aws {
|
|||
fclose($f);
|
||||
return true;
|
||||
} else {
|
||||
$err->raise("aws",sprintf(_("Problem to edit file %s"), $this->HTAFILE));
|
||||
$msg->raise('Error', "aws", _("Problem to edit file %s"), $this->HTAFILE);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -770,8 +780,8 @@ class m_aws {
|
|||
* EXPERIMENTAL 'sid' function ;)
|
||||
*/
|
||||
function alternc_export() {
|
||||
global $db,$err,$cuid;
|
||||
$err->log("aws","export");
|
||||
global $db,$msg,$cuid;
|
||||
$msg->log("aws","export");
|
||||
$str="<aws>\n";
|
||||
$db->query("SELECT login,pass FROM aws_users WHERE uid='$cuid';");
|
||||
while ($db->next_record()) {
|
||||
|
|
|
@ -28,7 +28,8 @@ require_once("../class/config.php");
|
|||
include_once("head.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -45,14 +46,15 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['adm']['classcount'];
|
||||
|
||||
?>
|
||||
<h3><?php __("New AlternC account"); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<form method="post" action="adm_doadd.php" id="main" name="main" autocomplete="off">
|
||||
<?php csrf_get(); ?>
|
||||
|
@ -63,7 +65,7 @@ if (isset($error) && $error) {
|
|||
</td></tr>
|
||||
<tr>
|
||||
<th><label for="pass"><?php __("Initial password"); ?></label><span class="mandatory">*</span></th>
|
||||
<td><input type="password" id="pass" name="pass" autocomplete="off" class="int" value="<?php ehe($pass); ?>" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td>
|
||||
<td><input type="password" id="pass" name="pass" autocomplete="off" class="int" value="<?php ehe($pass); ?>" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf",$passwd_classcount); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="passconf"><?php __("Confirm password"); ?></label><span class="mandatory">*</span></th>
|
||||
|
|
|
@ -15,13 +15,13 @@ getFields($fields);
|
|||
|
||||
if (!empty($delete_id)) {
|
||||
if (! $authip->ip_delete($delete_id)) {
|
||||
$error="Error during deletion";
|
||||
$msg->raise('Error', "admin", _("Error during deletion"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($ipsub)) {
|
||||
if (! $authip->ip_save_whitelist($id, $ipsub, $infos)) {
|
||||
$error="Error during recording";
|
||||
$msg->raise('Error', "admin", _("Error during recording"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,9 +32,8 @@ $list_ip = $authip->list_ip_whitelist();
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
|
||||
<?php if (isset($error) && $error) { ?>
|
||||
<p class="alert alert-danger"><?php echo $error ?></p>
|
||||
<?php } ?>
|
||||
<?php echo $msg->msg_html_all(); ?>
|
||||
|
||||
<center>
|
||||
<p class="alert alert-warning"><?php __("Warning"); echo "<br/>"; __("The IP and subnet you have here are allowed for ALL users and ALL usages"); ?></p>
|
||||
</center>
|
||||
|
|
|
@ -27,7 +27,8 @@ require_once("../class/config.php");
|
|||
include("head.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@ require_once("../class/config.php");
|
|||
include_once("head.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit;
|
||||
}
|
||||
$fields = array (
|
||||
|
@ -43,19 +44,22 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (!$uid) {
|
||||
__("Account not found");
|
||||
$msg->raise('Error', "admin", _("Account not found"));
|
||||
echo $msg->msg_html_all();
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$admin->checkcreator($uid)) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$r=$admin->get($uid)) {
|
||||
__("User does not exist");
|
||||
$msg->raise('Error', "admin", _("User does not exist"));
|
||||
echo $msg->msg_html_all();
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -79,7 +83,8 @@ if (! ($confirmed ) ) {
|
|||
print "<h3>" . _("Domains of user: ") . $r["login"] . "</h3>";
|
||||
} else {
|
||||
if (empty($redirect)) {
|
||||
__("Missing redirect url.");
|
||||
$msg->raise('Error', "admin", _("Missing redirect url."));
|
||||
echo $msg->msg_html_all();
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -105,9 +110,7 @@ reset($domains);
|
|||
foreach ($domains as $key => $domain) {
|
||||
if (!$confirmed) print '<h4>' . $domain . '</h4><ul>';
|
||||
$dom->lock();
|
||||
if (!$r=$dom->get_domain_all($domain)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$r=$dom->get_domain_all($domain);
|
||||
$dom->unlock();
|
||||
# 2. for each subdomain
|
||||
if (is_array($r['sub'])) {
|
||||
|
@ -132,7 +135,7 @@ foreach ($domains as $key => $domain) {
|
|||
# 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";
|
||||
print "-- error in $sub.$domain: " . $msg->msg_str("Error", "") . "\n";
|
||||
}
|
||||
$dom->unlock();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
$fields = array (
|
||||
|
@ -54,9 +55,7 @@ if ($synchronise==true) {
|
|||
|
||||
$quota->create_missing_quota_profile();
|
||||
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<form method="post" action="adm_dodefquotas.php">
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -41,10 +42,7 @@ include_once("head.php");
|
|||
<hr id="topbar" />
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<br/>
|
||||
<h3><?php __("List of the websites having errors in the domain database."); ?></h3>
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit;
|
||||
}
|
||||
$fields = array (
|
||||
|
@ -54,19 +55,18 @@ if ($create_dom && !empty($create_dom_list) ) {
|
|||
}
|
||||
|
||||
if ($pass != $passconf) {
|
||||
$error = _("Passwords do not match");
|
||||
$msg->raise("Error", "admin", _("Passwords do not match"));
|
||||
include("adm_add.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
// Attemp to create, exit if fail
|
||||
if (!($u=$admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type, 0, $notes, 0, $dom_to_create, $db_server_id))) {
|
||||
$error=$err->errstr();
|
||||
include ("adm_add.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$error=_("The new member has been successfully created");
|
||||
|
||||
$msg->raise("Ok", "admin", _("The new member has been successfully created"));
|
||||
|
||||
include("adm_list.php");
|
||||
exit;
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
$fields = array (
|
||||
|
@ -45,18 +46,18 @@ getFields($fields);
|
|||
if($action == "add") {
|
||||
|
||||
if($quota->addtype($type)) {
|
||||
$error=_("Account type"). " \"".htmlentities($type)."\" "._("added");
|
||||
$msg->raise('Ok', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("added"));
|
||||
} else {
|
||||
$error=_("Account type"). " \"".htmlentities($type)."\" "._("could not be added");
|
||||
$msg->raise('Error', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("could not be added"));
|
||||
}
|
||||
include("adm_defquotas.php");
|
||||
} else if($action == "delete") {
|
||||
if($del_confirm == "y"){
|
||||
if(!empty($type)) {
|
||||
if($quota->deltype($type)) {
|
||||
$error=_("Account type"). " \"".htmlentities($type)."\" "._("deleted");
|
||||
$msg->raise('Ok', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("deleted"));
|
||||
} else {
|
||||
$error=_("Account type"). " \"".htmlentities($type)."\" "._("could not be deleted");
|
||||
$msg->raise('Error', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("could not be deleted"));
|
||||
}
|
||||
}
|
||||
include("adm_defquotas.php");
|
||||
|
@ -92,9 +93,9 @@ if($action == "add") {
|
|||
}
|
||||
|
||||
if($quota->setdefaults($c)) {
|
||||
$error=_("Default quotas successfully changed");
|
||||
$msg->raise('Ok', "admin", _("Default quotas successfully changed"));
|
||||
} else {
|
||||
$error=_("Default quotas could not be set.");
|
||||
$msg->raise('Error', "admin", _("Default quotas could not be set."));
|
||||
}
|
||||
include("adm_panel.php");
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -41,23 +42,23 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if($del_confirm == "y"){
|
||||
$error = "";
|
||||
foreach ($accountList as $key => $val) {
|
||||
if (!$admin->checkcreator($val)) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
if (!($u=$admin->get($val)) || !$admin->del_mem($val)) {
|
||||
$error .= sprintf(_("Member '%s' does not exist"),$val)."<br />";
|
||||
$msg->raise("Error", "admin", _("Member '%s' does not exist"),$val);
|
||||
} else {
|
||||
$error .= sprintf(_("Member %s successfully deleted"),$u["login"])."<br />";
|
||||
$msg->raise("Ok", "admin", _("Member %s successfully deleted"),$u["login"]);
|
||||
}
|
||||
}
|
||||
include("adm_list.php");
|
||||
exit();
|
||||
} else {
|
||||
if (!is_array($accountList) || count($accountList)==0) {
|
||||
$error=_("Please check the accounts you want to delete");
|
||||
$msg->raise("Error", "admin", _("Please check the accounts you want to delete"));
|
||||
require("adm_list.php");
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -56,12 +57,13 @@ getFields($fields);
|
|||
|
||||
|
||||
if ($subadmin==0 && !$admin->checkcreator($uid)) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($pass != $passconf) {
|
||||
$error = _("Passwords do not match");
|
||||
$msg->raise("Error", "admin", _("Passwords do not match"));
|
||||
include("adm_edit.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -71,9 +73,8 @@ if ($uid==$mem->user["uid"]) {
|
|||
}
|
||||
|
||||
if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration, $notes, $reset_quotas)){
|
||||
$error=$err->errstr();
|
||||
include("adm_edit.php");
|
||||
} else {
|
||||
$error=_("The member has been successfully edited");
|
||||
$msg->raise("Ok", "admin", _("The member has been successfully edited"));
|
||||
include("adm_list.php");
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -39,11 +40,9 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (!$admin->dom_lock($domain)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$admin->dom_lock($domain);
|
||||
|
||||
include("adm_doms.php");
|
||||
exit;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -39,9 +40,7 @@ include_once ("head.php");
|
|||
?>
|
||||
<h3><?php __("Manage installed domains"); ?></h3>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
$fields = array (
|
||||
"force" => array ("get", "integer", "0"),
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -22,11 +23,6 @@ include_once("head.php");
|
|||
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
|
||||
|
||||
$fields = array(
|
||||
"domup" => array("post", "array", ""),
|
||||
);
|
||||
|
@ -34,11 +30,12 @@ getFields($fields);
|
|||
|
||||
if (!empty($domup)) {
|
||||
if (!$dom->update_default_subdomains($domup)) {
|
||||
$error = _("There was an error during the record.");
|
||||
$msg->raise('Error', "admin", _("There was an error during the record."));
|
||||
} else {
|
||||
$error = _("Save done.");
|
||||
$msg->raise('Ok', "admin", _("Save done."));
|
||||
}
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
$tab = $dom->lst_default_subdomains();
|
||||
?>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -43,10 +44,7 @@ include_once("head.php");
|
|||
|
||||
<br />
|
||||
<?php
|
||||
if (!empty($error)) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<p>
|
||||
<?php __("Here is the list of domain types."); ?>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
require_once("../class/config.php");
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -20,12 +21,12 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if ( ! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced,$create_tmpdir,$create_targetdir) ) {
|
||||
die($err->errstr());
|
||||
if (! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced,$create_tmpdir,$create_targetdir) ) {
|
||||
include("adm_domstypedoedit.php");
|
||||
} else {
|
||||
$msg->raise('Ok', "admin", _("Domain type is updated"));
|
||||
include("adm_domstype.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
*/
|
||||
require_once("../class/config.php");
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -51,21 +52,17 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
|
||||
if (! $d=$dom->domains_type_get($name)) {
|
||||
$error=$err->errstr();
|
||||
echo $error;
|
||||
} else {
|
||||
$d=$dom->domains_type_get($name);
|
||||
?>
|
||||
|
||||
<h3><?php __("Edit a domain type"); ?> </h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error_edit) && $error_edit) {
|
||||
echo "<p class=\"alert alert-danger\">$error_edit</p>";
|
||||
$error_edit="";
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
} ?>
|
||||
if (! $msg->has_msgs("Error")) {
|
||||
?>
|
||||
|
||||
<form action="adm_domstypedoedit.php" method="post" name="main" id="main">
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
require_once("../class/config.php");
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -11,13 +12,9 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
|
||||
if (empty($name) || (! $dom->domains_type_regenerate($name)) ) {
|
||||
die($err->errstr());
|
||||
} else {
|
||||
$error="Regenerate pending";
|
||||
include("adm_domstype.php");
|
||||
if (! empty($name) || ($dom->domains_type_regenerate($name)) ) {
|
||||
$msg->raise('Ok', "admin", _("Regenerate pending"));
|
||||
}
|
||||
|
||||
include("adm_domstype.php");
|
||||
?>
|
||||
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -39,14 +40,12 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (!$admin->su2normal($uid)) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
$error=_("This account is now a normal account");
|
||||
}
|
||||
if ($admin->su2normal($uid)) {
|
||||
$msg->raise("Ok", "admin", _("This account is now a normal account"));
|
||||
}
|
||||
|
||||
include("adm_edit.php");
|
||||
|
||||
exit();
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -42,15 +43,15 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (!$admin->checkcreator($uid)) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$admin->renew_mem($uid, $periods)){
|
||||
$error=$err->errstr();
|
||||
include("adm_edit.php");
|
||||
} else {
|
||||
$error=_("The member has been successfully renewed");
|
||||
$msg->raise("Ok", "admin", _("The member has been successfully renewed"));
|
||||
include("adm_list.php");
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -39,14 +40,12 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (!$admin->normal2su($uid)) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
$error=_("This account is now an administrator account");
|
||||
if ($admin->normal2su($uid)) {
|
||||
$msg->raise("Ok", "admin", _("This account is now an administrator account"));
|
||||
}
|
||||
|
||||
include("adm_edit.php");
|
||||
|
||||
exit();
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -33,7 +33,8 @@ require_once("../class/config.php");
|
|||
include_once("head.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -45,22 +46,22 @@ getFields($fields);
|
|||
$subadmin=variable_get("subadmin_restriction");
|
||||
|
||||
if ($subadmin==0 && !$admin->checkcreator($uid)) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$r=$admin->get($uid)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$r=$admin->get($uid);
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['adm']['classcount'];
|
||||
|
||||
?>
|
||||
<h3><?php __("Member Edition"); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<form method="post" action="adm_doedit.php" name="main" id="main" autocomplete="off">
|
||||
<?php csrf_get(); ?>
|
||||
|
@ -88,7 +89,7 @@ if (!$r=$admin->get($uid)) {
|
|||
|
||||
<tr>
|
||||
<th><label for="pass"><?php __("Password"); ?></label></th>
|
||||
<td><input type="password" class="int" id="pass" autocomplete="off" name="pass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td>
|
||||
<td><input type="password" class="int" id="pass" autocomplete="off" name="pass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf",$passwd_classcount); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="passconf"><?php __("Confirm password"); ?></label></th>
|
||||
|
|
|
@ -27,7 +27,8 @@ require_once("../class/config.php");
|
|||
include("head.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -45,16 +46,13 @@ getFields($fields);
|
|||
|
||||
if ( !empty($submit) ) {
|
||||
if ($admin->mailallmembers($subject,$message,$from)) {
|
||||
$error=_("The email was successfully sent");
|
||||
$msg->raise("Ok", "admin", _("The email was successfully sent"));
|
||||
} else {
|
||||
$error=_("There was an error");
|
||||
$msg->raise("Ok", "admin", _("There was an error"));
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<form method="post" action="adm_email.php">
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -28,7 +28,8 @@ require_once("../class/config.php");
|
|||
include_once("head.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
include_once('foot.php');
|
||||
exit();
|
||||
}
|
||||
|
@ -54,7 +55,8 @@ $subadmin = variable_get("subadmin_restriction", 0);
|
|||
// If we ask for all account but we aren't "admin" and
|
||||
// subadmin var is not 1
|
||||
if ($show == "all" && !$subadmin == 1 && $cuid != 2000) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
include('foot.php');
|
||||
exit();
|
||||
}
|
||||
|
@ -130,9 +132,7 @@ if ($mem->user["admlist"] == 0) { // Normal (large) mode
|
|||
</fieldset>
|
||||
|
||||
<?php
|
||||
if (!empty($error)) {
|
||||
echo '<p class="alert alert-danger">', $error, '</p>';
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<p>
|
||||
|
@ -143,7 +143,8 @@ if (!empty($error)) {
|
|||
|
||||
<?php
|
||||
if (!is_array($accountList) || empty($accountList)) {
|
||||
echo '<p class="alert alert-danger">' . _("No account defined for now") . '</p>';
|
||||
$msg->raise('Error', "admin", _("No account defined for now"));
|
||||
echo $msg->msg_html_all();
|
||||
include('foot.php');
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -30,12 +30,13 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled || $cuid!=2000) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
die();
|
||||
}
|
||||
|
||||
$fields = array (
|
||||
"action" =>array ("get","string",""),
|
||||
"action" =>array ("get","string",""),
|
||||
);
|
||||
|
||||
getFields($fields);
|
||||
|
|
|
@ -46,14 +46,14 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) {
|
|||
list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]);
|
||||
$newuid=intval($newuid);
|
||||
if (!$newuid) {
|
||||
$error=_("Your authentication information are incorrect");
|
||||
$msg->raise("Error", "admin", _("Your authentication information are incorrect"));
|
||||
include("index.php");
|
||||
exit();
|
||||
}
|
||||
$admin->enabled=true;
|
||||
$r=$admin->get($newuid);
|
||||
if ($passcheck!=md5($r["pass"])) {
|
||||
$error=_("Your authentication information are incorrect");
|
||||
$msg->raise("Ok", "admin", _("Your authentication information are incorrect"));
|
||||
include("index.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -64,7 +64,6 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) {
|
|||
|
||||
// And we go back to the former administrator account :
|
||||
if (!$mem->setid($newuid)) {
|
||||
$error=$err->errstr();
|
||||
include("index.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -76,26 +75,25 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) {
|
|||
|
||||
// * with a user id to go to (we check the current account is admin and is allowed to connect to this account)
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
// Depending on subadmin_restriction, a subadmin can (or cannot) connect to account he didn't create
|
||||
$subadmin=variable_get("subadmin_restriction");
|
||||
if ($subadmin==0 && !$admin->checkcreator($id)) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$r=$admin->get($id)) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
if ($r=$admin->get($id)) {
|
||||
$oldid=$cuid."/".md5($mem->user["pass"]);
|
||||
setcookie('oldid',$oldid,0,'/');
|
||||
$_COOKIE['oldid']=$oldid;
|
||||
|
||||
if (!$mem->setid($id)) {
|
||||
$error=$err->errstr();
|
||||
include("index.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -110,9 +108,7 @@ include_once("head.php");
|
|||
?>
|
||||
<h3><?php __("Member login"); ?></h3>
|
||||
<?php
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
include_once("foot.php");
|
||||
?>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -44,29 +45,31 @@ getFields($fields);
|
|||
if ($delaccount) {
|
||||
// Delete an account
|
||||
if ($mail->del_slave_account($delaccount)) {
|
||||
$error=_("The requested account has been deleted. It is now denied.");
|
||||
$msg->raise('Ok', "admin", _("The requested account has been deleted. It is now denied."));
|
||||
}
|
||||
}
|
||||
if ($newlogin) {
|
||||
// Add an account
|
||||
if ($mail->add_slave_account($newlogin,$newpass)) {
|
||||
$error=_("The requested account address has been created. It is now allowed.");
|
||||
$msg->raise('Ok', "admin", _("The requested account address has been created. It is now allowed."));
|
||||
$newlogin='';$newpass='';
|
||||
}
|
||||
}
|
||||
|
||||
include_once("head.php");
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['adm']['classcount'];
|
||||
|
||||
?>
|
||||
<h3><?php __("Manage allowed accounts for secondary mx"); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
|
||||
$c=$mail->enum_slave_account();
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
if (is_array($c)) {
|
||||
|
||||
?>
|
||||
|
@ -100,7 +103,7 @@ for($i=0;$i<count($c);$i++) { ?>
|
|||
<tr><th><label for="newlogin"><?php __("Login"); ?></label></th><th><label for="newpass"><?php __("Password"); ?></label></th></tr>
|
||||
<tr>
|
||||
<td><input type="text" class="int" value="<?php ehe($newlogin); ?>" id="newlogin" name="newlogin" maxlength="64" size="32" /><br/><br/></td>
|
||||
<td><input type="password" class="int" autocomplete="off" value="<?php ehe($newpass); ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass"); ?></td>
|
||||
<td><input type="password" class="int" autocomplete="off" value="<?php ehe($newpass); ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","",$passwd_classcount); ?></td>
|
||||
</tr>
|
||||
<tr class="trbtn"><td colspan="2">
|
||||
<input type="submit" value="<?php __("Add this account to the allowed list"); ?>" class="inb" />
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -41,11 +42,7 @@ include_once("head.php");
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
include_once("foot.php");
|
||||
exit;
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<ul id="adm_panel">
|
||||
<li class="lst"><a href="adm_tld.php"><?php __("Manage allowed domains (TLD)"); ?></a></li>
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -50,38 +51,34 @@ include_once("head.php");
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
//echo "<pre>"; print_r($c); echo "</pre>";
|
||||
|
||||
if (isset($doedit) && $doedit) {
|
||||
if (!$c[$doedit]) {
|
||||
echo "<p class=\"alert alert-danger\">"._("Policy not found")."</p>";
|
||||
$msg->raise('Error', "admin", _("Policy not found"));
|
||||
} else {
|
||||
// Change it ;)
|
||||
if ($admin->editPolicy($doedit,$minsize,$maxsize,$classcount,$allowlogin)) {
|
||||
echo "<p class=\"info\">"._("Policy changed")."</p>";
|
||||
$msg->raise('Ok', "admin", _("Policy changed"));
|
||||
unset($edit);
|
||||
$c=$admin->listPasswordPolicies();
|
||||
} else {
|
||||
echo "<p class=\"alert alert-danger\">"._("Cannot edit the policy, an error occurred")."</p>";
|
||||
$msg->raise('Error', "admin", _("Cannot edit the policy, an error occurred"));
|
||||
}
|
||||
}
|
||||
}
|
||||
echo $msg->msg_html_all("<li>", true, true);
|
||||
|
||||
if (!empty($edit)) {
|
||||
if (!$c[$edit]) {
|
||||
echo "<p class=\"alert alert-danger\">"._("Policy not found")."</p>";
|
||||
$msg->raise('Error', "admin", _("Policy not found"));
|
||||
echo $msg->msg_html_all();
|
||||
} else {
|
||||
?>
|
||||
|
||||
<p><?php __("Please choose which policy you want to apply to this password kind:"); ?></p>
|
||||
<p><?php __("Please choose which policy you want to apply to this password kind:"); ?></p>
|
||||
|
||||
<p><b><?php echo $c[$edit]["description"]; ?></b></p>
|
||||
<p><b><?php echo $c[$edit]["description"]; ?></b></p>
|
||||
|
||||
<form method="post" action="adm_passpolicy.php">
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
$fields = array (
|
||||
|
@ -49,7 +50,10 @@ while (list($key,$val)=each($qlist)) {
|
|||
$quota->setquota($key,$_REQUEST[$var]);
|
||||
}
|
||||
$mem->unsu();
|
||||
$error=_("The quotas has been successfully edited");
|
||||
|
||||
if (!$msg->has_msgs("Error"))
|
||||
$msg->raise("Ok", "admin", _("The quotas has been successfully edited"));
|
||||
|
||||
include("adm_list.php");
|
||||
exit;
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@ require_once("../class/config.php");
|
|||
include_once("head.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -41,14 +42,10 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (!$us=$admin->get($uid)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$us=$admin->get($uid);
|
||||
|
||||
$mem->su($uid);
|
||||
if (!$r=$quota->getquota()) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$r=$quota->getquota();
|
||||
$mem->unsu();
|
||||
|
||||
?>
|
||||
|
@ -56,11 +53,7 @@ $mem->unsu();
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<form method="post" action="adm_quotadoedit.php">
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -48,13 +49,13 @@ getFields($fields);
|
|||
if ($delaccount) {
|
||||
// Delete an account
|
||||
if ($dom->del_slave_account($delaccount)) {
|
||||
$error=_("The requested account has been deleted. It is now denied.");
|
||||
$msg->raise('Ok', "admin", _("The requested account has been deleted. It is now denied."));
|
||||
}
|
||||
}
|
||||
if ($newlogin) {
|
||||
// Add an account
|
||||
if ($dom->add_slave_account($newlogin,$newpass)) {
|
||||
$error=_("The requested account address has been created. It is now allowed.");
|
||||
$msg->raise('Ok', "admin", _("The requested account address has been created. It is now allowed."));
|
||||
unset($newlogin); unset($newpass);
|
||||
}
|
||||
}
|
||||
|
@ -62,22 +63,21 @@ if ($newlogin) {
|
|||
if ($delip) {
|
||||
// Delete an ip address/class
|
||||
if ($dom->del_slave_ip($delip)) {
|
||||
$error=_("The requested ip address has been deleted. It will be denied in one hour.");
|
||||
$msg->raise('Ok', "admin", _("The requested ip address has been deleted. It will be denied in one hour."));
|
||||
}
|
||||
}
|
||||
if ($newip) {
|
||||
// Add an ip address/class
|
||||
if ($dom->add_slave_ip($newip,$newclass)) {
|
||||
$error=_("The requested ip address has been added to the list. It will be allowed in one hour.");
|
||||
$msg->raise('Ok', "admin", _("The requested ip address has been added to the list. It will be allowed in one hour."));
|
||||
unset($newip); unset($newclass);
|
||||
}
|
||||
}
|
||||
|
||||
include_once("head.php");
|
||||
|
||||
if (!empty($error)) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['adm']['classcount'];
|
||||
|
||||
?>
|
||||
<h3><?php __("Manage allowed ip for slave zone transfers"); ?></h3>
|
||||
|
@ -86,6 +86,8 @@ if (!empty($error)) {
|
|||
|
||||
$c=$dom->enum_slave_ip();
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
if (is_array($c)) { ?>
|
||||
<p>
|
||||
<?php __("Here is the list of the allowed ip or ip class for slave dns zone transfer requests (AXFR). You must add the ip address of all the slave DNS you have so that those slaves will be allowed to transfer the zone files. There is also some defaults ip from DNS checks made by some third-party technical offices such as afnic (for .fr domains)"); ?>
|
||||
|
@ -164,7 +166,7 @@ if (is_array($c)) { ?>
|
|||
<tr><th><label for="newlogin"><?php __("Login"); ?></label></th><th><label for="newpass"><?php __("Password"); ?></label></th></tr>
|
||||
<tr>
|
||||
<td><input type="text" class="int" value="<?php ehe( isset($newlogin)?$newlogin:'') ; ?>" id="newlogin" name="newlogin" maxlength="64" size="32" /><br/><br/></td>
|
||||
<td><input type="password" class="int" autocomplete="off" value="<?php ehe( (isset($newpass)?$newpass:'') ) ; ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass"); ?></td>
|
||||
<td><input type="password" class="int" autocomplete="off" value="<?php ehe( (isset($newpass)?$newpass:'') ) ; ?>" id="newpass" name="newpass" maxlength="64" size="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","",$passwd_classcount); ?></td>
|
||||
</tr>
|
||||
<tr class="trbtn"><td colspan="2"><input type="submit" value="<?php __("Add this account to the allowed list"); ?>" class="inb" /></td></tr>
|
||||
</table>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -41,13 +42,13 @@ getFields($fields);
|
|||
|
||||
|
||||
if (is_array($sel)) {
|
||||
$error="";
|
||||
for($i=0;$i<count($sel);$i++) {
|
||||
if (!$admin->deltld($sel[$i])) {
|
||||
$error.=_("Some TLD cannot be deleted...")." : ".$sel[$i]."<br />";
|
||||
$msg->raise("Error", "admin", _("Some TLD cannot be deleted...")." : ".$sel[$i]);
|
||||
}
|
||||
}
|
||||
if (!$error) $error=_("The requested TLD has been deleted");
|
||||
if (!$msg->has_msgs("Error"))
|
||||
$msg->raise("Ok", "admin", _("The requested TLD has been deleted"));
|
||||
}
|
||||
|
||||
include_once("head.php");
|
||||
|
@ -57,9 +58,7 @@ include_once("head.php");
|
|||
<hr id="topbar" />
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
$c=$admin->listtld();
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
$fields = array (
|
||||
|
@ -47,11 +48,7 @@ include_once ("head.php");
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<h3><?php __("Add a new TLD"); ?></h3>
|
||||
<p>
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -42,11 +43,10 @@ getFields($fields);
|
|||
|
||||
|
||||
if (!$admin->addtld($tld,$mode)) {
|
||||
$error=$err->errstr();
|
||||
include("adm_tldadd.php");
|
||||
exit();
|
||||
} else {
|
||||
$error=_("The TLD has been successfully added");
|
||||
$msg->raise("Ok", "admin", _("The TLD has been successfully added"));
|
||||
include("adm_tld.php");
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -36,16 +36,16 @@ getFields($fields);
|
|||
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$admin->edittld($tld,$mode)) {
|
||||
$error=$err->errstr();
|
||||
include("adm_tldedit.php");
|
||||
exit();
|
||||
} else {
|
||||
$error=_("The TLD has been successfully edited");
|
||||
$msg->raise("Ok", "admin", _("The TLD has been successfully edited"));
|
||||
include("adm_tld.php");
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -41,7 +42,6 @@ getFields($fields);
|
|||
|
||||
$mode=$admin->gettld($tld);
|
||||
if ($mode===false) {
|
||||
$error=$err->errstr();
|
||||
include("adm_tld.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -53,9 +53,7 @@ include_once("head.php");
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<h3><?php __("Edit a TLD"); ?></h3>
|
||||
|
||||
|
|
|
@ -31,13 +31,15 @@ require_once("../class/config.php");
|
|||
|
||||
if (!$admin->enabled) {
|
||||
if ( ! ( $isinvited && isset($oldid) && !empty($oldid) && $oldid==2000) ) { // Allow sub admins
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
if (! isset($L_INOTIFY_UPDATE_DOMAIN)) {
|
||||
__("Missing INOTIFY_UPDATE_DOMAIN var in /etc/alternc/local.sh . Fix it!");
|
||||
$msg->raise('Error', "admin", _("Missing INOTIFY_UPDATE_DOMAIN var in /etc/alternc/local.sh . Fix it!"));
|
||||
echo $msg->msg_html_all();
|
||||
die();
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
|
||||
if (!$admin->enabled) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "admin", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -47,7 +48,7 @@ include_once ("head.php");
|
|||
<h3><?php __("Configure AlternC variables"); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
|
||||
<?php echo $msg->msg_html_all(); ?>
|
||||
<p>
|
||||
<?php __("Here are the internal AlternC variables that are currently being used."); ?>
|
||||
</p>
|
||||
|
|
|
@ -59,26 +59,23 @@ if (isset($saveret) && $saveret) {
|
|||
|
||||
// Thanks to this, we bring you back to the EDIT form if the CSRF is invalid.
|
||||
// Allows you to re-submit
|
||||
$error="";
|
||||
// FIXME - doesn't work
|
||||
/* $csrf_check=false;
|
||||
if (count($_POST) && !defined("NOCSRF")) {
|
||||
if (csrf_check()<=0) {
|
||||
$error=$err->errstr();
|
||||
$csrf_check = true;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if ($error!="" && $bro->save($editfile,$R,$texte)) {
|
||||
$error=sprintf(_("Your file %s has been saved"),$editfile)." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")";
|
||||
if ($bro->save($editfile,$R,$texte)) {
|
||||
$msg->raise("Ok", "bro", _("Your file %s has been saved")." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")", $editfile);
|
||||
include("bro_main.php");
|
||||
exit();
|
||||
} else {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
}
|
||||
if (isset($save) && $save) {
|
||||
if ($bro->save($editfile,$R,$texte)) {
|
||||
$error=sprintf(_("Your file %s has been saved"),$editfile)." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")";
|
||||
} else {
|
||||
$error=$err->errstr();
|
||||
$msg->raise("Ok", "bro", _("Your file %s has been saved")." (".format_date(_('%3$d-%2$d-%1$d %4$d:%5$d'),date("Y-m-d H:i:s")).")", $editfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +83,9 @@ include_once("head.php");
|
|||
|
||||
?>
|
||||
<p>
|
||||
<?php if (isset($error) && $error) echo "<p class=\"alert alert-danger\">$error</p>"; ?>
|
||||
<?php
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<h3><?php echo _("File editing")." <code>".ehe($R,false)."/<b>".ehe($editfile,false)."</b></code><br />"; ?></h3>
|
||||
</p>
|
||||
|
||||
|
|
|
@ -67,16 +67,17 @@ if (!$R && $p["golastdir"]) {
|
|||
$R=$bro->convertabsolute($R,1);
|
||||
// on fait ?
|
||||
if (!empty($formu) && $formu) {
|
||||
$absolute = $bro->convertabsolute($R, false);
|
||||
switch ($formu) {
|
||||
case 1: // Create the folder $R.$nomfich
|
||||
if (!$bro->CreateDir($R,$nomfich)) {
|
||||
$error = $err->errstr();
|
||||
if ($bro->CreateDir($R,$nomfich)) {
|
||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully created"), $nomfich);
|
||||
}
|
||||
$p=$bro->GetPrefs();
|
||||
break;
|
||||
case 6: // Create the file $R.$nomfich
|
||||
if (!$bro->CreateFile($R,$nomfich)) {
|
||||
$error = $err->errstr();
|
||||
if ($bro->CreateFile($R,$nomfich)) {
|
||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully created"), $nomfich);
|
||||
}
|
||||
$p=$bro->GetPrefs();
|
||||
if ($p["createfile"]==1) {
|
||||
|
@ -88,8 +89,13 @@ if (!empty($formu) && $formu) {
|
|||
case 2: // act vaut Supprimer Copier ou Renommer.
|
||||
if ($actdel) {
|
||||
if (!empty($del_confirm) ) {
|
||||
if (!$bro->DeleteFile($d,$R)) {
|
||||
$error = $err->errstr();
|
||||
if ($bro->DeleteFile($d,$R)) {
|
||||
foreach ($d as $v) {
|
||||
if (is_dir($absolute . "/" . $v))
|
||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully deleted"), $v);
|
||||
else
|
||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully deleted"), $v);
|
||||
}
|
||||
}
|
||||
} elseif (empty($cancel) && is_array($d)) {
|
||||
include_once("head.php");
|
||||
|
@ -104,7 +110,7 @@ if (!empty($formu) && $formu) {
|
|||
<h2><?php echo $mem->user["login"].$R."/"; ?></h2>
|
||||
<ul>
|
||||
<?php foreach($d as $editfile){ ?>
|
||||
<li> <?php ehe($editfile); ?></li>
|
||||
<li><b> <?php ehe($editfile); ?></b></li>
|
||||
<input type="hidden" name="d[]" value="<?php ehe($editfile); ?>" />
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
@ -119,29 +125,47 @@ if (!empty($formu) && $formu) {
|
|||
}
|
||||
}
|
||||
if ($actcopy) {
|
||||
if (!$bro->CopyFile($d,$R,$actmoveto)) {
|
||||
$error = $err->errstr();
|
||||
if ($bro->CopyFile($d,$R,$actmoveto)) {
|
||||
if (count($d) == 1) {
|
||||
if (is_dir($absolute . "/" . $d[0]))
|
||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully copied to '%s'"), array($d[0], $actmoveto));
|
||||
else
|
||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully copied to '%s'"), array($d[0], $actmoveto));
|
||||
} else
|
||||
$msg->raise("Ok", "bro", _("The files / folders were successfully copied"));
|
||||
}
|
||||
}
|
||||
if ($actmove) {
|
||||
if (!$bro->MoveFile($d,$R,$actmoveto)) {
|
||||
$error = $err->errstr();
|
||||
if ($bro->MoveFile($d,$R,$actmoveto)) {
|
||||
if (count($d) == 1) {
|
||||
if (is_dir($absolute . "/" . $d[0]))
|
||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully moved to '%s'"), array($d[0], $actmoveto));
|
||||
else
|
||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully moved to '%s'"), array($d[0], $actmoveto));
|
||||
} else
|
||||
$msg->raise("Ok", "bro", _("The files / folders were successfully moved"));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4: // Renommage Effectif...
|
||||
if (!$bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names
|
||||
$error = $err->errstr();
|
||||
if ($bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names
|
||||
if (count($d) == 1) {
|
||||
if (is_dir($absolute . "/" . $d[0]))
|
||||
$msg->raise("Ok", "bro", _("The folder '%s' was successfully renamed to '%s'"), array($o[0], $d[0]));
|
||||
else
|
||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully renamed to '%s'"), array($o[0], $d[0]));
|
||||
} else
|
||||
$msg->raise("Ok", "bro", _("The files / folders were successfully renamed"));
|
||||
}
|
||||
break;
|
||||
case 3: // Upload de fichier...
|
||||
if (!$bro->UploadFile($R)) {
|
||||
$error = $err->errstr();
|
||||
if ($bro->UploadFile($R)) {
|
||||
$msg->raise("Ok", "bro", _("The file '%s' was successfully uploaded"), $_FILES['userfile']['name']);
|
||||
}
|
||||
break;
|
||||
case 7: // Changement de permissions [ML]
|
||||
if (!$bro->ChangePermissions($R, $d, $perm)) {
|
||||
$error = $err->errstr();
|
||||
if ($bro->ChangePermissions($R, $d)) {
|
||||
$msg->raise("Ok", "bro", _("The permissions were successfully set"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -149,12 +173,7 @@ if (!empty($formu) && $formu) {
|
|||
|
||||
if (isset($actextract) && $actextract) {
|
||||
if ($bro->ExtractFile($R. '/' . $fileextract, $R)) {
|
||||
echo "<p class=\"alert alert-danger\">";
|
||||
print $err->errstr();
|
||||
print _("failed")."<br />\n";
|
||||
echo "</p>";
|
||||
} else {
|
||||
print _("done")."<br />\n";
|
||||
$msg->raise("Ok", "bro", _("The extraction of the file '%s' was successfull"), $fileextract);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,12 +192,12 @@ if (isset($actextract) && $actextract) {
|
|||
/* Creation de la liste des fichiers courants */
|
||||
$c=$bro->filelist($R, $showdirsize );
|
||||
if ($c===false) {
|
||||
echo "<p class=\"alert alert-danger\">".$err->errstr()."</p>";
|
||||
echo $msg->msg_html_all();
|
||||
require_once('foot.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($error) && $error) echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<table><tr>
|
||||
|
|
|
@ -46,7 +46,7 @@ getFields($fields);
|
|||
|
||||
if (!empty($submit)) {
|
||||
$bro->SetPrefs($editsizex, $editsizey, $listmode, $showicons, $downfmt, $createfile, $showtype, $editor_font, $editor_size, $golastdir);
|
||||
$error=_("Your preferences have been updated.");
|
||||
$msg->raise("Ok", "bro", _("Your preferences have been updated."));
|
||||
include("bro_main.php");
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -8,10 +8,8 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (!empty($cronupdate)) {
|
||||
if (! $cron->update($cronupdate)) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
$error=_("Save done.");
|
||||
if ($cron->update($cronupdate)) {
|
||||
$msg->raise("ok", "mysql", _("Save done."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,9 +20,9 @@ $lst_cron = $cron->lst_cron();
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
|
||||
<?php if (isset($error) && $error) { ?>
|
||||
<p class="alert alert-danger"><?php echo $error ?></p>
|
||||
<?php } ?>
|
||||
<?php
|
||||
echo $msg->msg_html_all()
|
||||
?>
|
||||
|
||||
<form method="post" action="cron.php" id="main" name="cron" >
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -45,12 +45,12 @@ if (!isset($dns)) $dns="1";
|
|||
<h3><?php __("Domain hosting"); ?></h3>
|
||||
<hr />
|
||||
<?php
|
||||
if (!$quota->cancreate("dom")) { ?>
|
||||
<p class="alert alert-danger"><?php echo _("You cannot add any new domain, your quota is over.")." "._("Contact your administrator for more information."); ?></p>
|
||||
<?php
|
||||
exit();
|
||||
if (!$quota->cancreate("dom")) {
|
||||
$msg->raise('Alert', "dom", _("You cannot add any new domain, your quota is over.")." "._("Contact your administrator for more information."));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
if (isset($error) && $error) echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<form method="post" action="dom_doadd.php" id="main">
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -41,17 +41,19 @@ getFields($fields);
|
|||
$dom->lock();
|
||||
|
||||
if (!$dom->add_domain($newdomain,$dns,0,0,$newisslave,$slavedom)) {
|
||||
$error=$err->errstr();
|
||||
include("dom_add.php");
|
||||
exit();
|
||||
}
|
||||
} else
|
||||
$msg->raise('Ok', "dom", _("Your new domain %s has been successfully installed"),$newdomain);
|
||||
|
||||
$dom->unlock();
|
||||
|
||||
?>
|
||||
<h3><?php __("Add a domain"); ?></h3>
|
||||
<p>
|
||||
<?php printf(_("Your new domain %s has been successfully installed"),$newdomain); ?><br /><br />
|
||||
<?php
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<span class="inb"><a href="dom_edit.php?domain=<?php echo urlencode($newdomain);?>" ><?php __("Click here to continue"); ?></a></span><br />
|
||||
<?php $mem->show_help("add_domain"); ?>
|
||||
<br />
|
||||
|
|
|
@ -37,21 +37,22 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
$dom->lock();
|
||||
if ($del_confirm=="y")
|
||||
if ($del_confirm=="y") {
|
||||
if (!$dom->del_domain($domain)) {
|
||||
$error=$err->errstr();
|
||||
include("dom_edit.php");
|
||||
$dom->unlock();
|
||||
exit();
|
||||
}
|
||||
|
||||
$dom->unlock();
|
||||
}
|
||||
|
||||
if (! empty($del_cancel)) {
|
||||
$dom->lock();
|
||||
$dom->del_domain_cancel($domain);
|
||||
$dom->unlock();
|
||||
|
||||
// The link to this function is disable : the del_domain_cancel function need some modification
|
||||
__("Deletion have been successfully cancelled");?><br/>
|
||||
$msg->raise('Ok', "dom", _("Deletion have been successfully cancelled"));
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<p>
|
||||
<span class="ina"><a href="main.php" target="_parent"><?php __("Click here to continue"); ?></a></span>
|
||||
</p>
|
||||
|
@ -77,13 +78,16 @@ if ($del_confirm!="y") {
|
|||
</form>
|
||||
<?php include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
?>
|
||||
<h3><?php printf(_("Domain %s deleted"),$domain); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<p>
|
||||
<?php printf(_("The domain %s has been successfully deleted."),$domain); ?><br /><br />
|
||||
<?php
|
||||
$msg->raise('Ok', "dom", _("The domain %s has been successfully deleted."),$domain);
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
</p>
|
||||
<span class="ina"><a href="main.php" target="_parent"><?php __("Click here to continue"); ?></a></span>
|
||||
<?php $mem->show_help("del_domain"); ?>
|
||||
</p>
|
||||
|
|
|
@ -6,18 +6,15 @@ include_once("head.php");
|
|||
# Take the values of the subdomain in arguments
|
||||
|
||||
function sub_domains_edit($domain, $sub_domain_id=false) {
|
||||
global $admin, $err, $oldid, $isedit;
|
||||
global $admin, $msg, $oldid, $isedit;
|
||||
|
||||
$dom=new m_dom();
|
||||
$dom->lock();
|
||||
if (!$r=$dom->get_domain_all($domain)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
|
||||
$r=$dom->get_domain_all($domain);
|
||||
/*
|
||||
if (! empty($sub)) {
|
||||
if (!$sd=$dom->get_sub_domain_all($domain,$sub,$type,$value)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$sd=$dom->get_sub_domain_all($domain,$sub,$type,$value);
|
||||
}
|
||||
*/
|
||||
$sd=$dom->get_sub_domain_all($sub_domain_id);
|
||||
|
@ -26,6 +23,7 @@ $type=$sd['type'];
|
|||
$sub=$sd['name'];
|
||||
|
||||
$dom->unlock();
|
||||
|
||||
?>
|
||||
|
||||
<form action="dom_subdoedit.php" method="post" name="main" id="main">
|
||||
|
|
|
@ -38,16 +38,17 @@ getFields($fields);
|
|||
|
||||
$dom->lock();
|
||||
if (!$r=$dom->get_domain_all($domain)) {
|
||||
$error=$err->errstr();
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
$dom->unlock();
|
||||
echo $msg->msg_html_all();
|
||||
include('foot.php');
|
||||
die();
|
||||
}
|
||||
if (isset($error) && $error ) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
$dom->unlock();
|
||||
|
||||
?>
|
||||
<h3><img src="images/dom.png" alt="" /> <?php printf(_("Manage %s"),$domain); ?></h3>
|
||||
<?php
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function dnson() {
|
||||
|
@ -88,8 +89,6 @@ function destruction_alert() {
|
|||
}
|
||||
</script>
|
||||
|
||||
<h3><img src="images/dom.png" alt="" /> <?php printf(_("Manage %s"),$domain); ?></h3>
|
||||
|
||||
<?php
|
||||
|
||||
if ($r['dns_action']=='UPDATE') {?>
|
||||
|
|
|
@ -40,25 +40,17 @@ getFields($fields);
|
|||
|
||||
$dom->lock();
|
||||
|
||||
if (!$dom->edit_domain($domain,$dns,$email,0,$ttl)) {
|
||||
$error=$err->errstr();
|
||||
include("dom_edit.php");
|
||||
$dom->unlock();
|
||||
exit();
|
||||
}
|
||||
$dom->unlock();
|
||||
|
||||
?>
|
||||
<h3><?php printf(_("Editing domain %s"),$domain); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<p>
|
||||
<?php
|
||||
printf(_("The domain %s has been changed."),$domain);
|
||||
$r = $dom->get_domain_all($domain);
|
||||
if ($r["dns"] == $dns && $r["mail"] == $email && $r["zonettl"] == $ttl) {
|
||||
$msg->raise('Ok', "dom", _("No change has been requested..."));
|
||||
} else if ($dom->edit_domain($domain,$dns,$email,0,$ttl)) {
|
||||
$msg->raise('Ok', "dom", _("The domain %s has been changed."),$domain);
|
||||
$t = time();
|
||||
// XXX: we assume the cron job is at every 5 minutes
|
||||
print strtr(_("The modifications will take effect at %time. Server time is %now."), array('%now' => date('H:i:s', $t), '%time' => date('H:i:s', ($t-($t%300)+300))));
|
||||
?><br /><br />
|
||||
<span class="ina"><a href="dom_edit.php?domain=<?php echo urlencode($domain) ?>" ><?php __("Click here to continue"); ?></a></span>
|
||||
</p>
|
||||
<?php include_once("foot.php"); ?>
|
||||
$msg->raise('Ok', "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
||||
}
|
||||
$dom->unlock();
|
||||
|
||||
include("dom_edit.php");
|
||||
exit();
|
||||
?>
|
||||
|
|
|
@ -45,16 +45,16 @@ $domain=trim($domain);
|
|||
<br />
|
||||
|
||||
<?php
|
||||
if (!empty($error)) {
|
||||
echo '<p class="alert alert-danger">'.$error.'</p>';
|
||||
}
|
||||
if ( !empty($zone) && empty($domain) ) {
|
||||
$msg->raise('Alert', "dom", _("The domain field seems to be empty"));
|
||||
}
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<?php if ( !empty($zone) ) {
|
||||
if ( empty($domain) ) {
|
||||
echo '<p class="alert alert-danger">'._("The domain field seems to be empty").'</p>';
|
||||
} else { ?>
|
||||
<?php __("Here is my proposition. Modify your zone until my proposition seems good to you"); ?>
|
||||
if ( !empty($domain) ) {
|
||||
__("Here is my proposition. Modify your zone until my proposition seems good to you"); ?>
|
||||
<table class="tlist">
|
||||
<tr><th colspan=3><h2><?php printf(_("Working on %s"),$domain); ?></h2></th></tr>
|
||||
<tr>
|
||||
|
|
|
@ -36,22 +36,21 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
$dom->lock();
|
||||
if (!$r=$dom->get_sub_domain_all($sub_domain_id)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$r=$dom->get_sub_domain_all($sub_domain_id);
|
||||
$dom->unlock();
|
||||
|
||||
$dt=$dom->domains_type_lst();
|
||||
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "dom", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<h3><?php printf(_("Deleting subdomain %s"),ife($r['name'],$r['name'].".").$r['domain']); ?> : </h3>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
if ($msg->has_msgs('Error')) {
|
||||
echo $msg->msg_html_all();
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -78,7 +77,7 @@ if (isset($error) && $error) {
|
|||
</p>
|
||||
<blockquote>
|
||||
<input type="submit" class="inb" name="confirm" value="<?php __("Yes"); ?>" />
|
||||
<input type="button" class="inb" name="cancel" value="<?php __("No"); ?>" onclick="history.back();" />
|
||||
<span class="ina"><a href="dom_edit.php?domain=<?php echo urlencode($r['domain']) ?>"><?php __("No"); ?></a></span></p>
|
||||
</blockquote>
|
||||
</form>
|
||||
<?php include_once("foot.php"); ?>
|
||||
|
|
|
@ -36,28 +36,20 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
$dom->lock();
|
||||
if (!$r=$dom->get_sub_domain_all($sub_domain_id)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$r=$dom->get_sub_domain_all($sub_domain_id);
|
||||
$dt=$dom->domains_type_lst();
|
||||
$dom->unlock();
|
||||
|
||||
|
||||
$dt=$dom->domains_type_lst();
|
||||
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "dom", _("This page is restricted to authorized staff"));
|
||||
echo $msg->msg_html_all();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$dom->lock();
|
||||
if (!$r=$dom->get_sub_domain_all($sub_domain_id)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
|
||||
if (!$dom->del_sub_domain($sub_domain_id)) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
|
||||
$r=$dom->get_sub_domain_all($sub_domain_id);
|
||||
$dom->del_sub_domain($sub_domain_id);
|
||||
$dom->unlock();
|
||||
|
||||
?>
|
||||
|
@ -65,15 +57,15 @@ $dom->unlock();
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
if ($msg->has_msgs('Error')) {
|
||||
echo $msg->msg_html_all();
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
} else {
|
||||
$t = time();
|
||||
// XXX: we assume the cron job is at every 5 minutes
|
||||
$error=strtr(_("The modifications will take effect at %time. Server time is %now."), array('%now' => date('H:i:s', $t), '%time' => date('H:i:s', ($t-($t%300)+300))));
|
||||
echo "<p class=\"alert alert-info\">".$error."</p>";
|
||||
$msg->raise('Ok', "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
||||
echo $msg->msg_html_all();
|
||||
}
|
||||
?>
|
||||
<p><span class="ina"><a href="dom_edit.php?domain=<?php echo urlencode($r['domain']) ?>"><?php __("Click here to continue"); ?></a></span></p>
|
||||
|
|
|
@ -50,18 +50,17 @@ $dom->lock();
|
|||
|
||||
$dt=$dom->domains_type_lst();
|
||||
if ( (!isset($isinvited) || !$isinvited) && $dt[strtolower($type)]["enable"] != "ALL" ) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "dom", _("This page is restricted to authorized staff"));
|
||||
include("dom_edit.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (empty($sub_domain_id)) $sub_domain_id=null;
|
||||
$r=$dom->set_sub_domain($domain,$sub,$type,$value, $sub_domain_id);
|
||||
|
||||
$dom->unlock();
|
||||
|
||||
if (!$r) {
|
||||
$error=$err->errstr();
|
||||
$noread=true;
|
||||
include("dom_subedit.php");
|
||||
exit();
|
||||
|
@ -69,7 +68,7 @@ if (!$r) {
|
|||
$t = time();
|
||||
// XXX: we assume the cron job is at every 5 minutes
|
||||
$noread=false;
|
||||
$error=strtr(_("The modifications will take effect at %time. Server time is %now."), array('%now' => date('H:i:s', $t), '%time' => date('H:i:s', ($t-($t%300)+300))));
|
||||
$msg->raise('Ok', "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
||||
foreach($fields as $k=>$v) unset($$k);
|
||||
}
|
||||
include("dom_edit.php");
|
||||
|
|
|
@ -41,8 +41,7 @@ $dom->lock();
|
|||
$r=true;
|
||||
if (!isset($noread) || !$noread) {
|
||||
if (!$r=$dom->get_sub_domain_all($sub_domain_id)) {
|
||||
$error=$err->errstr();
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
echo $msg->msg_html_all();
|
||||
include_once('foot.php');
|
||||
die();
|
||||
}
|
||||
|
@ -56,21 +55,24 @@ if (!$r) {
|
|||
|
||||
$dt=$dom->domains_type_lst();
|
||||
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
|
||||
__("This page is restricted to authorized staff");
|
||||
$msg->raise('Error', "dom", _("This page is restricted to authorized staff"));
|
||||
include("dom_edit.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
$domroot=$dom->get_domain_all($r['domain']);
|
||||
$dom->unlock();
|
||||
|
||||
if ($msg->has_msgs("Error")) {
|
||||
include_once("dom_edit.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
echo "<h3>";
|
||||
__("Editing subdomain");
|
||||
echo " http://"; ecif($r['name'],$r['name']."."); echo $r['domain']."</h3>";
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
$dom->unlock();
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<hr id="topbar"/>
|
||||
|
|
|
@ -19,14 +19,13 @@ $sub=$domi['name'];
|
|||
$dom->unlock();
|
||||
|
||||
if (!$r) {
|
||||
$error=$err->errstr();
|
||||
$noread=true;
|
||||
include("dom_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
$t = time();
|
||||
// XXX: we assume the cron job is at every 5 minutes
|
||||
$error=strtr(_("The modifications will take effect at %time. Server time is %now."), array('%now' => date('H:i:s', $t), '%time' => date('H:i:s', ($t-($t%300)+300))));
|
||||
$msg->raise('Ok', "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
|
||||
foreach($fields as $k=>$v) unset($k);
|
||||
}
|
||||
include("dom_edit.php");
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -29,7 +29,6 @@
|
|||
*/
|
||||
require_once("../class/config.php");
|
||||
|
||||
$error="";
|
||||
// On parcours les POST_VARS et on repere les del_.
|
||||
reset($_POST);
|
||||
$lst_todel=array();
|
||||
|
@ -54,10 +53,8 @@ getFields($fields);
|
|||
if(!empty($confirm_del)) {
|
||||
foreach($lst_todel as $v) {
|
||||
$r=$ftp->delete_ftp($v);
|
||||
if (!$r) {
|
||||
$error.=$err->errstr()."<br />";
|
||||
} else {
|
||||
$error.=sprintf(_("The ftp account %s has been successfully deleted"),$r)."<br />";
|
||||
if ($r) {
|
||||
$msg->raise("Ok", "ftp", _("The ftp account %s has been successfully deleted"),$r);
|
||||
}
|
||||
}
|
||||
include("ftp_list.php");
|
||||
|
@ -71,7 +68,7 @@ if(!empty($confirm_del)) {
|
|||
<?php __("Do you really want to delete those accounts?");?>
|
||||
<ul>
|
||||
<?php foreach($lst_todel as $t) {
|
||||
echo "<li>".$names[$t]."</li>\n";
|
||||
echo "<li><b>".$names[$t]."</b></li>\n";
|
||||
} ?>
|
||||
</ul>
|
||||
|
||||
|
@ -87,7 +84,6 @@ if(!empty($confirm_del)) {
|
|||
<?php
|
||||
include_once('foot.php');
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -39,16 +39,8 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if ($pass != $passconf) {
|
||||
$error = _("Passwords do not match");
|
||||
include_once("head.php");
|
||||
echo "<h3>"._("Create a FTP account")."</h3><p class=\"alert alert-danger\">$error</p>";
|
||||
include("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (! $id && !$create) { //not a creation and not an edit
|
||||
$error=_("Error: neither a creation nor an edition");
|
||||
$msg->raise("Error", "ftp", _("Error: neither a creation nor an edition"));
|
||||
include("ftp_list.php");
|
||||
exit();
|
||||
}
|
||||
|
@ -60,7 +52,6 @@ if (! $id ) { //create
|
|||
}
|
||||
|
||||
if (!$r) {
|
||||
$error=$err->errstr();
|
||||
$is_include=true;
|
||||
$rr[0]["prefixe"]=$prefixe;
|
||||
$rr[0]["login"]=$login;
|
||||
|
@ -68,11 +59,11 @@ if (!$r) {
|
|||
include_once("ftp_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
if ($create) {
|
||||
$error=_("The ftp account has been successfully created");
|
||||
} else {
|
||||
$error=_("The ftp account has been successfully saved");
|
||||
}
|
||||
if ($create)
|
||||
$msg->raise("Ok", "ftp", _("The ftp account has been successfully created"));
|
||||
else
|
||||
$msg->raise("Ok", "ftp", _("The ftp account has been successfully saved"));
|
||||
|
||||
include("ftp_list.php");
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -40,29 +40,27 @@ if ( !isset($is_include) ) {
|
|||
}
|
||||
|
||||
if (!$id && !$create) {
|
||||
$error=_("Neither a creation nor a edition");
|
||||
$msg->raise("Error", "ftp", _("Neither a creation nor a edition"));
|
||||
echo "<h3>"._("Create a FTP account")."</h3>";
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
echo $msg->msg_html_all();
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$id && $create) { //creation
|
||||
echo "<h3>"._("Create a FTP account")."</h3>";
|
||||
$rr=false;
|
||||
if ( !isset($is_include) )
|
||||
$rr=false;
|
||||
} else {
|
||||
echo "<h3>"._("Editing a FTP account")."</h3>";
|
||||
echo "<h3>"._("Editing a FTP account")."</h3>";
|
||||
$rr=$ftp->get_ftp_details($id);
|
||||
if (!$rr) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['ftp']['classcount'];
|
||||
|
||||
?>
|
||||
<form method="post" action="ftp_doedit.php" name="main" id="main" autocomplete="off">
|
||||
<?php csrf_get(); ?>
|
||||
|
@ -88,7 +86,7 @@ if (isset($error) && $error) {
|
|||
</tr>
|
||||
<tr id='ftp_tr_pass1'>
|
||||
<th><label for="pass"><?php __("Password"); ?></label></th>
|
||||
<td><input type="password" class="int" name="pass" autocomplete="off" id="pass" size="20" maxlength="64" value=""/><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td>
|
||||
<td><input type="password" class="int" name="pass" autocomplete="off" id="pass" size="20" maxlength="64" value=""/><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf",$passwd_classcount); ?></td>
|
||||
</tr>
|
||||
<tr id='ftp_tr_pass2'>
|
||||
<th><label for="passconf"><?php __("Confirm password"); ?></label></th>
|
||||
|
|
|
@ -38,7 +38,6 @@ getFields($fields);
|
|||
$noftp=false;
|
||||
if (!$r=$ftp->get_list($domain)) {
|
||||
$noftp=true;
|
||||
$error=$err->errstr();
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -47,24 +46,20 @@ if (!$r=$ftp->get_list($domain)) {
|
|||
<br />
|
||||
|
||||
<?php
|
||||
if (isset($error) && $error && !$noftp) {
|
||||
?>
|
||||
<p class="alert alert-danger"><?php echo $error ?></p>
|
||||
<?php } ?>
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
<?php if ($quota->cancreate("ftp")) { ?>
|
||||
<p>
|
||||
if ($quota->cancreate("ftp")) { ?>
|
||||
<p>
|
||||
<span class="inb add"><a href="ftp_edit.php?create=1"><?php __("Create a new ftp account"); ?></a></span>
|
||||
</p>
|
||||
<?php } ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
<?php
|
||||
if ($noftp) {
|
||||
?>
|
||||
<?php $mem->show_help("ftp_list_no"); ?>
|
||||
<?php
|
||||
include_once("foot.php");
|
||||
}
|
||||
if ($noftp) {
|
||||
$mem->show_help("ftp_list_no");
|
||||
include_once("foot.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<form method="post" action="ftp_del.php">
|
||||
|
@ -80,7 +75,7 @@ while (list($key,$val)=each($r)) { ?>
|
|||
<td align="center"><input type="checkbox" class="inc" id="del_<?php ehe($val["id"]); ?>" name="del_<?php ehe($val["id"]); ?>" value="<?php ehe($val["id"]); ?>" /></td>
|
||||
<td><div class="ina edit"><a href="ftp_edit.php?id=<?php eue($val["id"]); ?>"><?php __("Edit"); ?></a></div></td>
|
||||
|
||||
<td><a href='ftp_switch_enable.php?id=<?php eue($val['id'],false); echo '&status='.( ($val['enabled'])?'0':'1' ) ;?>' onClick='return confirm("<?php __("Are you sure you want to change his status?"); ?>");'><?php
|
||||
<td><a href='ftp_switch_enable.php?id=<?php eue($val['id']); echo '&status='.( ($val['enabled'])?'0':'1' ) ;?>' onClick='return confirm("<?php __("Are you sure you want to change his status?"); ?>");'><?php
|
||||
if ( $val['enabled']) {
|
||||
echo "<img src='images/check_ok.png' alt=\""._("Enabled")."\"/>";
|
||||
echo "<span style='display:none;'>ENABLED</span>"; // for tablesorter
|
||||
|
|
|
@ -31,6 +31,11 @@ $fields = array (
|
|||
|
||||
getFields($fields);
|
||||
|
||||
$ftp->switch_enabled($id,$status);
|
||||
if ($ftp->switch_enabled($id,$status)) {
|
||||
if ($status)
|
||||
$msg->raise("Ok", "ftp", _("The ftp account is enabled"));
|
||||
else
|
||||
$msg->raise("Ok", "ftp", _("The ftp account is disabled"));
|
||||
}
|
||||
|
||||
require_once('ftp_list.php');
|
||||
|
|
|
@ -30,10 +30,12 @@
|
|||
require_once("../class/config.php");
|
||||
include_once("head.php");
|
||||
|
||||
$fields = array (
|
||||
"dir" => array ("request", "string", ""),
|
||||
);
|
||||
getFields($fields);
|
||||
if (!isset($is_include)) {
|
||||
$fields = array (
|
||||
"dir" => array ("request", "string", ""),
|
||||
);
|
||||
getFields($fields);
|
||||
}
|
||||
|
||||
?>
|
||||
<h3><?php __("Protect a folder"); ?></h3>
|
||||
|
@ -43,11 +45,8 @@ getFields($fields);
|
|||
<?php __("Enter the name of the folder you want to protect. It must already exists."); ?>
|
||||
</p>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
include_once("foot.php");
|
||||
exit;
|
||||
} ?>
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<form method="post" action="hta_doadd.php" name="main" id="main">
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -39,9 +39,10 @@ getFields($fields);
|
|||
?>
|
||||
<h3><?php printf(_("Adding a username in %s"),$dir); ?></h3>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['hta']['classcount'];
|
||||
?>
|
||||
|
||||
<form method="post" action="hta_doadduser.php" name="main" id="main" autocomplete="off">
|
||||
|
@ -61,7 +62,7 @@ getFields($fields);
|
|||
</tr>
|
||||
<tr>
|
||||
<th><label for="password"><?php __("Password"); ?></label></th>
|
||||
<td><input type="password" class="int" name="password" autocomplete="off" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#password","#passwordconf"); ?></td>
|
||||
<td><input type="password" class="int" name="password" autocomplete="off" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#password","#passwordconf",$passwd_classcount); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="passwordconf"><?php __("Confirm password"); ?></label></th>
|
||||
|
|
|
@ -29,18 +29,14 @@
|
|||
*/
|
||||
require_once("../class/config.php");
|
||||
|
||||
$error="";
|
||||
// On parcours les POST_VARS et on repere les del_.
|
||||
reset($_POST);
|
||||
while (list($key,$val)=each($_POST)) {
|
||||
if (substr($key,0,4)=="del_") {
|
||||
// Effacement du dossier $val
|
||||
// $r=$hta->DelDir($val);
|
||||
$return = $hta->DelDir($val);
|
||||
if (!$return) {
|
||||
$error.= $err->errstr()."<br />";
|
||||
} else {
|
||||
$error.= sprintf(_("The protected folder %s has been successfully unprotected"),$val)."<br />";
|
||||
if ($return) {
|
||||
$msg->raise("Ok", "hta",_("The protected folder %s has been successfully unprotected"),$val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,18 +36,13 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if(empty($dir)) {
|
||||
$error=_("No directory specified");
|
||||
$msg->raise("Error", "hta", _("No directory specified"));
|
||||
include("hta_list.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if(!$hta->CreateDir($dir)) {
|
||||
$error=$err->errstr();
|
||||
} else if(!$hta->CreateDir($dir)) {
|
||||
$is_include=true;
|
||||
include("hta_add.php");
|
||||
exit();
|
||||
} else {
|
||||
$msg->raise("Ok", "hta", _("Folder %s is protected"), $dir);
|
||||
include("hta_list.php");
|
||||
}
|
||||
|
||||
include("hta_list.php");
|
||||
exit();
|
||||
|
||||
?>
|
||||
|
|
|
@ -38,15 +38,15 @@ getFields($fields);
|
|||
|
||||
|
||||
if ($password != $passwordconf) {
|
||||
$error = _("Passwords do not match");
|
||||
$msg->raise("Error", "hta", _("Passwords do not match"));
|
||||
include("hta_adduser.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$hta->add_user($user, $password, $dir)) {
|
||||
$error=$err->errstr();
|
||||
include ("hta_adduser.php");
|
||||
} else {
|
||||
} else {
|
||||
$msg->raise("Ok", "hta", _("The user %s was added to th protected folder %s"), array($user, $dir));
|
||||
include ("hta_edit.php");
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -38,10 +38,13 @@ getFields($fields);
|
|||
|
||||
if (!empty($confirm_del)) {
|
||||
reset($d);
|
||||
if (!$hta->del_user($d,$dir)) {
|
||||
$error=$err->errstr();
|
||||
if ($hta->del_user($d,$dir)) {
|
||||
foreach ($d as $v) {
|
||||
$msg->raise("Ok", "hta", _("The user '%s' was successfully deleted"), $v);
|
||||
}
|
||||
}
|
||||
header ('Location: /hta_edit.php?dir='.urlencode($dir));
|
||||
$is_include=true;
|
||||
include_once("hta_edit.php");
|
||||
exit();
|
||||
}
|
||||
include_once('head.php');
|
||||
|
@ -52,7 +55,7 @@ include_once('head.php');
|
|||
<?php __("Do you really want to delete those users ?");?>
|
||||
<ul>
|
||||
<?php foreach($d as $t) {
|
||||
echo "<li>".ehe($t,false)."</li>\n";
|
||||
echo "<li><b>".ehe($t,false)."</b></li>\n";
|
||||
} ?>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -39,26 +39,16 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if ($newpass != $newpassconf) {
|
||||
$error = _("Passwords do not match");
|
||||
$msg->raise("Error", "hta", _("Passwords do not match"));
|
||||
include("hta_edituser.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$hta->change_pass($user,$newpass,$dir)) {
|
||||
$error=$err->errstr();
|
||||
if ($hta->change_pass($user,$newpass,$dir)) {
|
||||
$msg->raise("Ok", "hta", _("The password of the user %s has been successfully changed"), $user);
|
||||
$is_include=true;
|
||||
include_once("hta_edit.php");
|
||||
} else {
|
||||
include("hta_edituser.php");
|
||||
}
|
||||
|
||||
?>
|
||||
<h3><?php printf(_("Change the user %s in the protected folder %s"),$user,$dir); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
else {
|
||||
echo "<p>".sprintf(_("The password of the user %s has been successfully changed"),$user)."</p>";
|
||||
}
|
||||
echo "<p><span class=\"ina\"><a href=\"hta_edit.php?dir=$dir\">"._("Click here to continue")."</a></span></p>";
|
||||
?>
|
||||
<?php include_once("foot.php"); ?>
|
||||
|
|
|
@ -30,10 +30,12 @@
|
|||
require_once("../class/config.php");
|
||||
include_once("head.php");
|
||||
|
||||
$fields = array (
|
||||
if (!isset($is_include)) {
|
||||
$fields = array (
|
||||
"dir" => array ("request", "string", ""),
|
||||
);
|
||||
getFields($fields);
|
||||
);
|
||||
getFields($fields);
|
||||
}
|
||||
|
||||
if (!$dir) {
|
||||
echo "<p class=\"alert alert-warning\">"._("No folder selected!")."</p>";
|
||||
|
@ -41,20 +43,22 @@ if (!$dir) {
|
|||
die();
|
||||
} else {
|
||||
$r=$hta->get_hta_detail($dir);
|
||||
if (!$r) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
} // if !$dir
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['hta']['classcount'];
|
||||
|
||||
?>
|
||||
<h3><?php printf(_("List of authorized user in folder %s"),$dir); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (!count($r)) {
|
||||
echo "<p class=\"alert alert-warning\">".sprintf(_("No authorized user in %s"),$dir)."</p>";
|
||||
$msg->raise("Info", "hta", _("No authorized user in %s"),$dir);
|
||||
echo $msg->msg_html_all();
|
||||
} else {
|
||||
reset($r);
|
||||
reset($r);
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<form method="post" action="hta_dodeluser.php">
|
||||
<?php csrf_get(); ?>
|
||||
|
@ -108,7 +112,7 @@ for($i=0;$i<count($r);$i++){ ?>
|
|||
</tr>
|
||||
<tr>
|
||||
<th><label for="password"><?php __("Password"); ?></label></th>
|
||||
<td><input type="password" class="int" name="password" autocomplete="off" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#password","#passwordconf"); ?></td>
|
||||
<td><input type="password" class="int" name="password" autocomplete="off" id="password" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#password","#passwordconf",$passwd_classcount); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="passwordconf"><?php __("Confirm password"); ?></label></th>
|
||||
|
|
|
@ -36,12 +36,17 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['hta']['classcount'];
|
||||
|
||||
?>
|
||||
<h3><?php printf(_("Editing user %s in the protected folder %s"),$user,$dir); ?></h3>
|
||||
<hr id="topbar"/>
|
||||
<br />
|
||||
|
||||
<?php if (!empty($error) ) { echo "<p class=\"alert alert-danger\">$error</p>"; } ?>
|
||||
<?php
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<form method="post" action="hta_doedituser.php" name="main" id="main" autocomplete="off">
|
||||
<?php csrf_get(); ?>
|
||||
|
@ -63,7 +68,7 @@ getFields($fields);
|
|||
</tr>
|
||||
<tr>
|
||||
<th><label for="newpass"><?php __("New password"); ?></label></th>
|
||||
<td><input type="password" class="int" name="newpass" autocomplete="off" id="newpass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpassconf"); ?></td>
|
||||
<td><input type="password" class="int" name="newpass" autocomplete="off" id="newpass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpassconf",$passwd_classcount); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="newpassconf"><?php __("Confirm password"); ?></label></th>
|
||||
|
|
|
@ -30,10 +30,8 @@
|
|||
require_once("../class/config.php");
|
||||
include_once("head.php");
|
||||
|
||||
if (!$r=$hta->ListDir()) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
reset($r);
|
||||
if ($r=$hta->ListDir()) {
|
||||
reset($r);
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -41,17 +39,15 @@ if (!$r=$hta->ListDir()) {
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
if (!is_array($r)) {
|
||||
echo "<p><span class=\"ina\"><a href=\"hta_add.php\">"._("Protect a folder")."</a></span><br />";
|
||||
$mem->show_help("hta_list");
|
||||
echo "</p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
if (!is_array($r)) {
|
||||
echo "<p><span class=\"ina\"><a href=\"hta_add.php\">"._("Protect a folder")."</a></span><br />";
|
||||
$mem->show_help("hta_list");
|
||||
echo "</p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -26,15 +26,12 @@
|
|||
|
||||
require_once("../class/config_nochk.php");
|
||||
|
||||
if ($mem->checkid()) {
|
||||
if ($mem->checkid(false)) {
|
||||
Header("Location: /main.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$mem->del_session()) {
|
||||
// No need to draw an error message ...
|
||||
//$error=$err->errstr();
|
||||
}
|
||||
$mem->del_session();
|
||||
|
||||
$H=getenv("HTTP_HOST");
|
||||
|
||||
|
@ -72,11 +69,10 @@ if ( empty($logo) || ! $logo ) {
|
|||
$logo = 'images/logo.png';
|
||||
}
|
||||
?>
|
||||
|
||||
<p id="logo"> <img src="<?php echo $logo; ?>" border="0" alt="<?php __("Web Hosting Control Panel"); ?>" title="<?php __("Web Hosting Control Panel"); ?>" />
|
||||
<p id='logo'> <img src="<?php echo $logo; ?>" border="0" height="100px" alt="<?php __("Web Hosting Control Panel"); ?>" title="<?php __("Web Hosting Control Panel"); ?>" />
|
||||
</p>
|
||||
<p> </p>
|
||||
<?php if (isset($error) && $error) echo "<div class='alert alert-danger'>$error</div>"; ?>
|
||||
<?php echo $msg->msg_html_all(); ?>
|
||||
<br/>
|
||||
<?php
|
||||
if (isset($_GET['authip_token'])) $authip_token=$_GET['authip_token'];
|
||||
|
|
|
@ -20,25 +20,25 @@ if (!empty($s_protocol)) {
|
|||
getFields($fields);
|
||||
|
||||
if (! $authip->ip_affected_save($s_ipsub, $s_protocol, $$val) ) {
|
||||
$error="Error during ip_affected_save";
|
||||
$msg->raise('Error', "ftp", _("Error during ip_affected_save"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($delete_affected_id)) {
|
||||
if (! $authip->ip_affected_delete($delete_affected_id)) {
|
||||
$error="Error during deletion";
|
||||
$msg->raise('Error', "ftp", _("Error during deletion"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($delete_id)) {
|
||||
if (! $authip->ip_delete($delete_id)) {
|
||||
$error="Error during deletion";
|
||||
$msg->raise('Error', "ftp", _("Error during deletion"));
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($ipsub)) {
|
||||
if (! $authip->ip_save($id, $ipsub, $infos)) {
|
||||
$error="Error during recording";
|
||||
$msg->raise('Error', "ftp", _("Error during recording"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,9 +51,9 @@ $lac = $authip->list_affected();
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
|
||||
<?php if (isset($error) && $error) { ?>
|
||||
<p class="alert alert-danger"><?php echo $error ; $error=''; ?></p>
|
||||
<?php } ?>
|
||||
<?php
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<p><?php __("Here you can add rules to restrict access to AlternC's services, filtered by IP. First, add trusted IPs in the 'Known IP and networks' list. Then, add rules to grant access on services to the chosen IPs from this list.") ?></p>
|
||||
|
||||
|
@ -164,7 +164,7 @@ foreach($list_ip as $i) {
|
|||
}
|
||||
echo "<tr class='lst' ><td>{$i['infos']}</td><td>{$i['ip_human']}</td><td>$txt</td>";
|
||||
?>
|
||||
<td><div class="ina edit"><a href="javascript:edit_ip(<?php echo "'".htmlentities($i['id'])."','".htmlentities($i['ip_human'])."','".htmlentities($i['infos'])."'"; ?>);"><?php __("Edit"); ?></a></div></td>
|
||||
<td><div class="ina edit"><a href="javascript:edit_ip(<?php echo "'".htmlentities($i['id'])."','".htmlentities($i['ip_human'])."',".htmlentities($i['infos']); ?>);"><?php __("Edit"); ?></a></div></td>
|
||||
<td><div class="ina delete"><a href="ip_main.php?delete_id=<?php echo urlencode($i["id"]) ?>"><?php __("Delete"); ?></a></div></td>
|
||||
</tr>
|
||||
|
||||
|
@ -174,7 +174,7 @@ foreach($list_ip as $i) {
|
|||
<hr/>
|
||||
<h3><?php __("Add an IP or a networks");?></h3>
|
||||
|
||||
<p><a href="javascript:edit_ip('','<?php ehe(get_remote_ip())."','Home IP'";?>);" ><?php echo __("Add my current IP"); ?></a></p>
|
||||
<p><a href="javascript:edit_ip('','<?php ehe(get_remote_ip()."','Home IP'");?>);" ><?php echo __("Add my current IP"); ?></a></p>
|
||||
<span id="form_add_ip">
|
||||
<form method="post" action="ip_main.php" name="main" >
|
||||
<?php csrf_get(); ?>
|
||||
|
|
|
@ -59,24 +59,51 @@ function false_if_empty(id,err_msg) {
|
|||
}
|
||||
}
|
||||
|
||||
function generate_password(len){
|
||||
len = parseInt(len);
|
||||
if(!len)
|
||||
len = 8;
|
||||
var password = "";
|
||||
var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
var charsN = chars.length;
|
||||
var nextChar;
|
||||
|
||||
for(i=0; i<len; i++){
|
||||
nextChar = chars.charAt(Math.floor(Math.random()*charsN));
|
||||
password += nextChar;
|
||||
function generate_password(passwordLength, classcount) {
|
||||
passwordLength = parseInt(passwordLength);
|
||||
if(!passwordLength)
|
||||
passwordLength = 8;
|
||||
|
||||
classcount = parseInt(classcount);
|
||||
if(!classcount)
|
||||
classcount = 3;
|
||||
|
||||
var numberChars = "0123456789";
|
||||
var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
var lowerChars = "abcdefghiklmnopqrstuvwxyz";
|
||||
var specialchars = "(!#$%&'()*+,-./:;<=>?@[\]^_";
|
||||
|
||||
if (classcount >= 4) {
|
||||
var allChars = numberChars + upperChars + lowerChars + specialchars;
|
||||
} else {
|
||||
var allChars = numberChars + upperChars + lowerChars;
|
||||
}
|
||||
return password;
|
||||
var randPasswordArray = Array(passwordLength);
|
||||
randPasswordArray[0] = numberChars;
|
||||
randPasswordArray[1] = upperChars;
|
||||
randPasswordArray[2] = lowerChars;
|
||||
if (classcount == 4) {
|
||||
randPasswordArray[3] = specialchars;
|
||||
randPasswordArray = randPasswordArray.fill(allChars, 4);
|
||||
} else {
|
||||
randPasswordArray = randPasswordArray.fill(allChars, 3);
|
||||
}
|
||||
|
||||
return shuffleArray(randPasswordArray.map(function(x) { return x[Math.floor(Math.random() * x.length)] })).join('');
|
||||
}
|
||||
|
||||
function generate_password_html(id, size, field1, field2) {
|
||||
$("#z"+id).html("<input id='inp"+id+"' type='textbox' size=8 readonly='readonly' value='"+generate_password(size)+"' /> <a href='javascript:generate_password_html("+id+","+size+",\""+field1+"\",\""+field2+"\");'><img src='/images/refresh.png' alt='Refresh' title='Refresh'/></a>");
|
||||
function shuffleArray(array) {
|
||||
for (var i = array.length - 1; i > 0; i--) {
|
||||
var j = Math.floor(Math.random() * (i + 1));
|
||||
var temp = array[i];
|
||||
array[i] = array[j];
|
||||
array[j] = temp;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
function generate_password_html(id, size, field1, field2, classcount) {
|
||||
$("#z"+id).html("<input id='inp"+id+"' type='textbox' size=8 readonly='readonly' value='"+generate_password(size, classcount)+"' /> <a href='javascript:generate_password_html("+id+","+size+",\""+field1+"\",\""+field2+"\");'><img src='/images/refresh.png' alt='Refresh' title='Refresh'/></a>");
|
||||
$("#inp"+id).focus();
|
||||
$("#inp"+id).select();
|
||||
if (field1 != "") { $(field1).val( $("#inp"+id).val() ); }
|
||||
|
|
|
@ -34,9 +34,5 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (empty($file)) {
|
||||
$error="";
|
||||
}
|
||||
|
||||
$log->download_link($file);
|
||||
?>
|
||||
|
|
|
@ -36,11 +36,11 @@ $list=$log->list_logs_directory_all($log->get_logs_directory());
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
if(!$list || empty($list['dir'])){
|
||||
echo "<p class=\"alert alert-danger\">"._("You have no web logs to list at the moment.")."</p>";
|
||||
$msg->raise('Info', "logs", _("You have no web logs to list at the moment."));
|
||||
echo $msg->msg_html_all();
|
||||
include_once('foot.php');
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -36,10 +36,6 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (empty($file)) {
|
||||
$error="";
|
||||
}
|
||||
|
||||
include_once("head.php");
|
||||
|
||||
$string=$log->tail($file,$lines);
|
||||
|
@ -63,7 +59,7 @@ if (!$string) {
|
|||
} ?>
|
||||
<select id="lines" name="lines" onchange="document.forms['update'].submit()">
|
||||
<?php
|
||||
$alines=array(10=>10, 20=>20, 30=>30, 50=>50, 100=>100, 200=>200, 500=>500, 1000=>1000, 5000=>5000);
|
||||
$alines=array(10=>10, 20=>20, 30=>30, 50=>50, 100=>100, 200=>200, 500=>500, 1000=>1000);
|
||||
eoption($alines,$lines);
|
||||
?>
|
||||
</select> <?php __("Last lines shown"); ?>
|
||||
|
@ -73,11 +69,7 @@ eoption($alines,$lines);
|
|||
<hr id="topbar"/>
|
||||
<br />
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
<pre style=" white-space: pre-wrap; /* CSS 3 */
|
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
|
||||
|
|
|
@ -41,10 +41,27 @@ reset($d);
|
|||
include_once ("head.php");
|
||||
|
||||
if ($confirm=="y") {
|
||||
$error="";
|
||||
while (list($key,$val)=each($d)) {
|
||||
$mail->delete($val);
|
||||
$error.=$err->errstr()."<br />";
|
||||
// Validate that this email is owned by me...
|
||||
if (!($email = $mail->is_it_my_mail($val))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Search for that address:
|
||||
$db->query("SELECT a.id, NOT ISNULL(m.id) AS islocal FROM address a LEFT JOIN mailbox m ON m.address_id=a.id WHERE a.id= ? ;", array($val));
|
||||
|
||||
if (!$db->next_record()) {
|
||||
$msg->raise('Error', "mail", _("The email %s does not exist, it can't be deleted"), $email);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($mail->delete($val)) {
|
||||
if ($db->f("islocal")) {
|
||||
$msg->raise('Ok', "mail", _("The email %s has been marked for deletion"), $email);
|
||||
} else {
|
||||
$msg->raise('Ok', "mail", _("The email %s has been successfully deleted"), $email);
|
||||
}
|
||||
}
|
||||
}
|
||||
include("mail_list.php");
|
||||
exit();
|
||||
|
@ -61,15 +78,15 @@ if ($confirm=="y") {
|
|||
<input type="hidden" name="confirm" value="y" />
|
||||
<input type="hidden" name="domain_id" value="<?php ehe($domain_id); ?>" />
|
||||
|
||||
<ul>
|
||||
<?php
|
||||
|
||||
while (list($key,$val)=each($d)) {
|
||||
$m=$mail->get_details($val);
|
||||
echo "<input type=\"hidden\" name=\"d[]\" value=\"".ehe($val,false)."\" />";
|
||||
echo $m["address"]."@".$m["domain"]."<br />";
|
||||
echo "<li><b>".$m["address"]."@".$m["domain"]."</b></li>";
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" class="inb" name="submit" value="<?php __("Confirm the deletion"); ?>" /> - <input type="button" name="cancel" id="cancel" onclick="window.history.go(-1);" class="inb" value="<?php __("Don't delete anything and go back to the email list"); ?>"/>
|
||||
|
|
|
@ -30,10 +30,10 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (!($res=$mail->create($domain_id,$mail_arg))) {
|
||||
$error=$err->errstr();
|
||||
include("mail_list.php");
|
||||
} else {
|
||||
$_REQUEST["mail_id"]=$res;
|
||||
$new_account=true;
|
||||
include("mail_edit.php");
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -28,6 +28,7 @@ require_once("../class/config.php");
|
|||
|
||||
$fields = array (
|
||||
"mail_id" =>array ("post","integer",""),
|
||||
"new_account" =>array ("post","integer",""),
|
||||
"pass" => array ("post","string",""),
|
||||
"passconf" => array("post","string",""),
|
||||
"quotamb" => array("post","integer",0),
|
||||
|
@ -39,12 +40,10 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
$isedit=true; // if we go back to edit, it will know ;)
|
||||
$error="";
|
||||
|
||||
// We check that email first ... so that we can compare its status with our ...
|
||||
if (!$res=$mail->get_details($mail_id)) {
|
||||
$error=$err->errstr();
|
||||
include("main.php");
|
||||
include("mail_list.php");
|
||||
exit();
|
||||
} else {
|
||||
|
||||
|
@ -52,21 +51,27 @@ if (!$res=$mail->get_details($mail_id)) {
|
|||
/*
|
||||
* checking the password
|
||||
*/
|
||||
if(isset($pass) && $pass != ""){
|
||||
if($pass != $passconf){
|
||||
$error = _("Passwords do not match");
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
if (!$mail->set_passwd($mail_id,$pass)) { /* SET THE PASSWORD */
|
||||
$error=$err->errstr();
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
$error.=$err->errstr()."<br />";
|
||||
if($pass != $passconf){
|
||||
$msg->raise("Error", "mail", _("Passwords do not match"));
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
$canbeempty = ($islocal != 1 || ($islocal == 1 && !$new_account))?true:false;
|
||||
if ($new_account || !empty($pass) || $islocal != 1) {
|
||||
if ($islocal != 1)
|
||||
$pass = "";
|
||||
|
||||
if (!$mail->set_passwd($mail_id,$pass,$canbeempty)) { /* SET THE PASSWORD */
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (!$new_account && empty($pass) && $islocal == 1 && $res['password'] == "") {
|
||||
if (!$mail->set_passwd($mail_id,$pass, false)) { /* SET THE PASSWORD */
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
@ -74,20 +79,14 @@ if (!$res=$mail->get_details($mail_id)) {
|
|||
*/
|
||||
if ($res["enabled"] && !$enabled) {
|
||||
if (!$mail->disable($mail_id)) { /* DISABLE */
|
||||
$error=$err->errstr();
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
$error.=$err->errstr()."<br />";
|
||||
}
|
||||
}
|
||||
if (!$res["enabled"] && $enabled) {
|
||||
if (!$mail->enable($mail_id)) { /* ENABLE */
|
||||
$error=$err->errstr();
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
$error.=$err->errstr()."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,11 +95,8 @@ if (!$res=$mail->get_details($mail_id)) {
|
|||
* now the islocal + quota + recipients
|
||||
*/
|
||||
if (!$mail->set_details($mail_id,$islocal,$quotamb,$recipients)) { /* SET OTHERS */
|
||||
$error=$err->errstr();
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
$error.=$err->errstr()."<br />";
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,15 +108,15 @@ if (!$res=$mail->get_details($mail_id)) {
|
|||
include ("mail_edit.php");
|
||||
exit();
|
||||
} else {
|
||||
foreach($rh as $h) if ($h) $error.=$h."<br />";
|
||||
foreach($rh as $h) if ($h) $msg->raise("Error", "mail", $h);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!$error || !trim($error,"<br />")) {
|
||||
unset($error);
|
||||
$success=_("Your email has been edited successfully");
|
||||
}
|
||||
if ($new_account)
|
||||
$msg->raise("Ok", "mail", _("Your email has been created successfully"));
|
||||
else
|
||||
$msg->raise("Ok", "mail", _("Your email has been edited successfully"));
|
||||
|
||||
$_REQUEST["domain_id"]=$dom->get_domain_byname($res["domain"]);
|
||||
include("mail_list.php");
|
||||
|
|
|
@ -37,8 +37,7 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (!$res=$mail->get_details($mail_id)) {
|
||||
$error=$err->errstr();
|
||||
include("main.php");
|
||||
include("mail_list.php");
|
||||
exit();
|
||||
} else {
|
||||
|
||||
|
@ -56,9 +55,10 @@ if (!$res=$mail->get_details($mail_id)) {
|
|||
|
||||
|
||||
<?php
|
||||
if (isset($error)) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['pop']['classcount'];
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<form action="mail_doedit.php" method="post" name="main" id="main" autocomplete="off">
|
||||
|
@ -68,6 +68,7 @@ if (isset($error)) {
|
|||
<input type="password" style="display: none" id="fakePassword" name="fakePassword" value="" />
|
||||
|
||||
<input type="hidden" name="mail_id" value="<?php ehe($mail_id); ?>" />
|
||||
<input type="hidden" name="new_account" value="<?php echo isset($new_account)?$new_account:false;?>" />
|
||||
<table class="tedit">
|
||||
<tr><th colspan="2"><b><?php __("Is this email enabled?"); ?></b></th></tr>
|
||||
|
||||
|
@ -92,20 +93,20 @@ if (isset($error)) {
|
|||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<input type="radio" name="islocal" id="islocal0" class="inc" value="0"<?php cbox($islocal==0); ?> onclick="popoff()" /><label for="islocal0"><?php __("No"); ?></label>
|
||||
<input type="radio" name="islocal" id="islocal1" class="inc" value="1"<?php cbox($islocal==1); ?> onclick="popon();" /><label for="islocal1"><?php __("Yes"); ?></label>
|
||||
<input type="radio" name="islocal" id="islocal0" class="inc" value="0"<?php !isset($new_account)?cbox($islocal==0):""; ?> onclick="popoff()" /><label for="islocal0"><?php __("No"); ?></label>
|
||||
<input type="radio" name="islocal" id="islocal1" class="inc" value="1"<?php !isset($new_account)?cbox($islocal==1):cbox($islocal==0); ?> onclick="popon();" /><label for="islocal1"><?php __("Yes"); ?></label>
|
||||
</p>
|
||||
<div id="poptbl">
|
||||
<table class="tedit" >
|
||||
<tr id='mail_edit_pass' style='display: none;'><td colspan='2'><a href='javascript:mail_edit_pass();'><?php __("Click here to edit the existing password");?></a></td></tr>
|
||||
<tr id='mail_edit_pass1'><td><label for="pass"><?php __("Enter a POP/IMAP password"); ?></label></td><td><input type="password" class="int" autocomplete="off" name="pass" id="pass" value="" size="20" maxlength="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td></tr>
|
||||
<tr id='mail_edit_pass1'><td><label for="pass"><?php __("Enter a POP/IMAP password"); ?></label></td><td><input type="password" class="int" autocomplete="off" name="pass" id="pass" value="" size="20" maxlength="32" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf",$passwd_classcount); ?></td></tr>
|
||||
<tr id='mail_edit_pass2'><td><label for="passconf"><?php __("Confirm password"); ?></label></td><td><input type="password" class="int" autocomplete="off" name="passconf" id="passconf" value="" size="20" maxlength="32" /></td></tr>
|
||||
<tr><td><label for="quotamb"><?php __("Maximum allowed size of this Mailbox"); ?></label></td><td><input type="text" class="int intleft" style="text-align: right" name="quotamb" id="quotamb" value="<?php ehe($quotamb); ?>" size="7" maxlength="6" /><span class="int intright"><?php __("MB"); ?></span></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</td></tr>
|
||||
<?php if ($islocal) { ?>
|
||||
<tr id="turnoff"><td colspan="2" class="alert alert-warning"><?php __("WARNING: turning POP/IMAP off will DELETE the stored messages in this email address."); ?></td></tr>
|
||||
<tr id="turnoff" style="display: none;"><td colspan="2" class="alert alert-warning"><?php __("WARNING: turning POP/IMAP off will DELETE the stored messages in this email address."); ?></td></tr>
|
||||
<?php } ?>
|
||||
<tr><th colspan="2"><b><?php __("Is it a redirection to other email addresses?"); ?></b></th></tr>
|
||||
|
||||
|
|
|
@ -44,28 +44,10 @@ if(!$domain_id ) {
|
|||
exit();
|
||||
}
|
||||
|
||||
$fatal=false;
|
||||
|
||||
if ($domain=$dom->get_domain_byid($domain_id)) {
|
||||
if(!($mails_list = $mail->enum_domain_mails($domain_id,$search,$offset,$count,$show_systemmails)) && $search) {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
$mails_list = $mail->enum_domain_mails($domain_id,$search,$offset,$count,$show_systemmails);
|
||||
$allmails_list = $mail->enum_domain_mails($domain_id,$search,$offset,$count,'true');
|
||||
} else {
|
||||
$error=$err->errstr();
|
||||
$fatal=true;
|
||||
}
|
||||
|
||||
if ($fatal) {
|
||||
echo "<div class=\"alert alert-danger\">$error</div>";
|
||||
} else {
|
||||
|
||||
if (isset($error) && !empty($error)) {
|
||||
echo "<p class='alert alert-danger'>$error</p>";
|
||||
} else if (isset($success)) {
|
||||
echo "<p class=\"alert alert-success\">$success</p>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table>
|
||||
|
@ -75,7 +57,10 @@ if ($fatal) {
|
|||
echo '<h3>'._("Create a new mail account")."</h3>";
|
||||
} else {
|
||||
echo '<h3>'._("Manage Catch-all")."</h3>";
|
||||
} ?>
|
||||
}
|
||||
|
||||
echo $msg->msg_html_all("<li>", true, true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -100,9 +85,8 @@ if ($fatal) {
|
|||
<h3><?php printf(_("Email addresses of the domain %s"),$domain); ?> : </h3>
|
||||
<?php
|
||||
if (empty($allmails_list) && empty($search)) {
|
||||
echo "<p><i>";
|
||||
__("No mails for this domain.");
|
||||
echo "</i></p><br/>";
|
||||
$msg->raise('Error', 'mail', _("No mails for this domain."));
|
||||
echo $msg->msg_html_all();
|
||||
} else {
|
||||
|
||||
?>
|
||||
|
@ -188,7 +172,7 @@ if (date("Y-m-d")==substr($val["lastlogin"],0,10)) echo substr($val["lastlogin"]
|
|||
</form>
|
||||
|
||||
<?php
|
||||
} } // end if no mail for this domain
|
||||
} // end if no mail for this domain
|
||||
?>
|
||||
<hr/>
|
||||
|
||||
|
@ -303,7 +287,6 @@ if (date("Y-m-d")==substr($val["lastlogin"],0,10)) echo substr($val["lastlogin"]
|
|||
</div><!-- tabs-mailhelp-in -->
|
||||
</div><!-- tabs-mailhelp -->
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
|
|
@ -34,37 +34,32 @@ $fields = array (
|
|||
getFields($fields);
|
||||
|
||||
if (is_null($domain_id)) {
|
||||
echo "<p alert alert-danger\>";
|
||||
__("Problem with the domain");
|
||||
echo"</p>";
|
||||
include_once("foot.php");
|
||||
$msg->raise("Error", "mail", _("Problem with the domain"));
|
||||
include_once("mail_list.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!is_null($target_type)) {
|
||||
switch ($target_type) {
|
||||
case "none":
|
||||
$mail->catchall_del($domain_id);
|
||||
$error=_("Catchall successfully deleted");
|
||||
if ($mail->catchall_del($domain_id))
|
||||
$msg->raise("Ok", "mail", _("Catchall successfully deleted"));
|
||||
|
||||
require_once("mail_list.php");
|
||||
exit();
|
||||
break;
|
||||
case "domain":
|
||||
if ($mail->catchall_set($domain_id, $target_domain)) {
|
||||
$error=_("Catchall successfully updated");
|
||||
$msg->raise("Ok", "mail", _("Catchall successfully updated"));
|
||||
require_once("mail_list.php");
|
||||
exit();
|
||||
} else {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
break;
|
||||
case "mail":
|
||||
if ($mail->catchall_set($domain_id, $target_mail)) {
|
||||
$error=_("Catchall successfully updated");
|
||||
$msg->raise("Ok", "mail", _("Catchall successfully updated"));
|
||||
require_once("mail_list.php");
|
||||
exit();
|
||||
} else {
|
||||
$error=$err->errstr();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -80,9 +75,7 @@ $catch=$mail->catchall_getinfos($domain_id);
|
|||
<br />
|
||||
|
||||
<?php
|
||||
if (isset($error) && !empty($error) ) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
__("You can choose what to do with emails sent to unexisting address of this domain");
|
||||
?>
|
||||
|
|
|
@ -29,8 +29,10 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
$mail->undelete($mail_id);
|
||||
$error=$err->errstr();
|
||||
if ($mail->undelete($mail_id)) {
|
||||
$email = $mail->is_it_my_mail($mail_id)
|
||||
$msg->raise('Ok', "mail", _("The email %s has been undeleted"), $email);
|
||||
}
|
||||
|
||||
include("mail_list.php");
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ if ($mem->user["lastfail"]) {
|
|||
printf(_("%1\$d login failed since last login")."<br />",$mem->user["lastfail"]);
|
||||
}
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
if (!empty($error) ) { echo "<p class='alert alert-danger'>$error</p>";$error=''; }
|
||||
|
||||
$feed_url = variable_get('rss_feed', '', 'This is an RSS feed that will be displayed on the users homepages when they log in.', array('desc'=>'URL','type'=>'string'));
|
||||
|
|
|
@ -31,10 +31,8 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (!$mem->adminpref($admlist)) {
|
||||
$error=$err->errstr();
|
||||
} else {
|
||||
$error=_("Your administrator preferences has been successfully changed.");
|
||||
if ($mem->adminpref($admlist)) {
|
||||
$msg->raise('Ok', "mem", _("Your administrator preferences has been successfully changed."));
|
||||
}
|
||||
|
||||
include_once("head.php");
|
||||
|
@ -42,8 +40,8 @@ include_once("head.php");
|
|||
?>
|
||||
<h3><?php __("Admin preferences"); ?></h3>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
|
||||
|
||||
include_once("foot.php");
|
||||
?>
|
||||
<?php include_once("foot.php"); ?>
|
||||
|
|
|
@ -34,21 +34,24 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (!($cle=$mem->ChangeMail1($newmail))) {
|
||||
$error=$err->errstr();
|
||||
if ($cle=$mem->ChangeMail1($newmail)) {
|
||||
$msg->raise('Ok', "mem", _("The mail was successfully changed"));
|
||||
}
|
||||
|
||||
include_once("head.php");
|
||||
|
||||
?>
|
||||
<h3><?php __("Change the email of the account"); ?></h3>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
if ($msg->has_msgs('Error')) {
|
||||
echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
printf(_("help_mem_chgmail %s"),$newmail);
|
||||
?>
|
||||
<p class="code"><?php echo $cle; ?></p>
|
||||
<p><span class="ina"><a href="mem_param.php"><?php __("Click here to continue"); ?></a></span></p>
|
||||
|
||||
<?php include_once("foot.php"); ?>
|
||||
|
|
|
@ -41,11 +41,12 @@ getFields($fields);
|
|||
?>
|
||||
<h3><?php __("Change the email of the account"); ?></h3>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
if ($msg->has_msgs('Error')) {
|
||||
echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
<form method="post" action="mem_cm2.php">
|
||||
<?php csrf_get(); ?>
|
||||
|
@ -57,4 +58,4 @@ if (isset($error) && $error) {
|
|||
<tr><td align="center" colspan="3"><input type="submit" class="inb" name="submit" value="<?php __("OK"); ?>" /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include_once("foot.php"); ?>
|
||||
<?php include_once("foot.php"); ?>
|
||||
|
|
|
@ -37,8 +37,8 @@ $fields = array (
|
|||
);
|
||||
getFields($fields);
|
||||
|
||||
if (!$mem->ChangeMail2($cookie,$cle,$usr)) {
|
||||
$error=$err->errstr();
|
||||
if ($mem->ChangeMail2($cookie,$cle,$usr)) {
|
||||
$msg->raise('Ok', "mem", _("The mailbox has been successfully changed."));
|
||||
}
|
||||
|
||||
include_once("head.php");
|
||||
|
@ -46,14 +46,9 @@ include_once("head.php");
|
|||
?>
|
||||
<h3><?php __("Change the email of the account"); ?></h3>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
echo $msg->msg_html_all();
|
||||
|
||||
__("The mailbox has been successfully changed.");
|
||||
echo "<p><span class='ina'><a href='mem_param.php'>"._("Click here to continue")."</a></span></p>";
|
||||
|
||||
include_once("foot.php");
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -40,17 +40,21 @@ getFields($fields);
|
|||
|
||||
if (!empty($help_setting)) {
|
||||
$mem->set_help_param($showhelp);
|
||||
$error=_("Your help setting has been updated.");
|
||||
$msg->raise('Ok', "mem", _("Your help setting has been updated."));
|
||||
}
|
||||
|
||||
?>
|
||||
<div align="center"><h3><?php __("Settings of your account"); ?></h3></div>
|
||||
<?php
|
||||
if (isset($error) && $error) {
|
||||
echo "<font color=red>$error</font>";
|
||||
include_once("foot.php");
|
||||
exit();
|
||||
}
|
||||
if ($msg->has_msgs('Error')) {
|
||||
include_once("mem_param.php");
|
||||
exit();
|
||||
}
|
||||
|
||||
$c=$admin->listPasswordPolicies();
|
||||
$passwd_classcount = $c['mem']['classcount'];
|
||||
|
||||
echo $msg->msg_html_all();
|
||||
?>
|
||||
|
||||
<div id="tabsmem">
|
||||
|
@ -86,7 +90,7 @@ echo "<p>";
|
|||
|
||||
<table border="1" cellspacing="0" cellpadding="4" class="tedit" >
|
||||
<tr><th><?php __("Old password"); ?></th><td><input type="password" class="int" name="oldpass" value="<?php isset($oldpass) ? : $oldpass=""; ehe($oldpass); ?>" size="20" maxlength="128" /></td></tr>
|
||||
<tr><th><?php __("New password"); ?> (1)</th><td><input type="password" class="int" autocomplete="off" id="newpass" name="newpass" value="<?php isset($newpass) ? : $newpass=""; ehe($newpass); ?>" size="20" maxlength="60" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpass2"); ?></td></tr>
|
||||
<tr><th><?php __("New password"); ?> (1)</th><td><input type="password" class="int" autocomplete="off" id="newpass" name="newpass" value="<?php isset($newpass) ? : $newpass=""; ehe($newpass); ?>" size="20" maxlength="60" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#newpass","#newpass2",$passwd_classcount); ?></td></tr>
|
||||
<tr><th><?php __("New password"); ?> (2)</th><td><input type="password" class="int" autocomplete="off" id="newpass2" name="newpass2" value="<?php isset($newpass2) ? : $newpass2=""; ehe($newpass2);?>" size="20" maxlength="61" /></td></tr>
|
||||
<tr class="trbtn"><td colspan="3"><input type="submit" class="inb ok" name="submit" value="<?php __("Change my password"); ?>" /></td></tr>
|
||||
</table>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue