classe admin / fichiers section admin associés
This commit is contained in:
parent
0d5caada2f
commit
b16c3ac69a
|
@ -28,7 +28,8 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,14 +46,15 @@ $fields = array (
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
|
$c=$admin->listPasswordPolicies();
|
||||||
|
$passwd_classcount = $c['adm']['classcount'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h3><?php __("New AlternC account"); ?></h3>
|
<h3><?php __("New AlternC account"); ?></h3>
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<form method="post" action="adm_doadd.php" id="main" name="main" autocomplete="off">
|
<form method="post" action="adm_doadd.php" id="main" name="main" autocomplete="off">
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
@ -63,7 +65,7 @@ if (isset($error) && $error) {
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><label for="pass"><?php __("Initial password"); ?></label><span class="mandatory">*</span></th>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<th><label for="passconf"><?php __("Confirm password"); ?></label><span class="mandatory">*</span></th>
|
<th><label for="passconf"><?php __("Confirm password"); ?></label><span class="mandatory">*</span></th>
|
||||||
|
|
|
@ -15,13 +15,13 @@ getFields($fields);
|
||||||
|
|
||||||
if (!empty($delete_id)) {
|
if (!empty($delete_id)) {
|
||||||
if (! $authip->ip_delete($delete_id)) {
|
if (! $authip->ip_delete($delete_id)) {
|
||||||
$error="Error during deletion";
|
$msg->raise('Error', "admin", _("Error during deletion")); // à traduire
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($ipsub)) {
|
if (!empty($ipsub)) {
|
||||||
if (! $authip->ip_save_whitelist($id, $ipsub, $infos)) {
|
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"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<?php if (isset($error) && $error) { ?>
|
<?php echo $msg->msg_html_all(); ?>
|
||||||
<p class="alert alert-danger"><?php echo $error ?></p>
|
|
||||||
<?php } ?>
|
|
||||||
<center>
|
<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>
|
<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>
|
</center>
|
||||||
|
|
|
@ -27,7 +27,8 @@ require_once("../class/config.php");
|
||||||
include("head.php");
|
include("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,8 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
$fields = array (
|
$fields = array (
|
||||||
|
@ -43,19 +44,22 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$uid) {
|
if (!$uid) {
|
||||||
__("Account not found");
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
|
echo $msg->msg_html_all();
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$admin->checkcreator($uid)) {
|
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");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$r=$admin->get($uid)) {
|
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");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -79,7 +83,8 @@ if (! ($confirmed ) ) {
|
||||||
print "<h3>" . _("Domains of user: ") . $r["login"] . "</h3>";
|
print "<h3>" . _("Domains of user: ") . $r["login"] . "</h3>";
|
||||||
} else {
|
} else {
|
||||||
if (empty($redirect)) {
|
if (empty($redirect)) {
|
||||||
__("Missing redirect url.");
|
$msg->raise('Error', "admin", _("Missing redirect url."));
|
||||||
|
echo $msg->msg_html_all();
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -105,9 +110,7 @@ reset($domains);
|
||||||
foreach ($domains as $key => $domain) {
|
foreach ($domains as $key => $domain) {
|
||||||
if (!$confirmed) print '<h4>' . $domain . '</h4><ul>';
|
if (!$confirmed) print '<h4>' . $domain . '</h4><ul>';
|
||||||
$dom->lock();
|
$dom->lock();
|
||||||
if (!$r=$dom->get_domain_all($domain)) {
|
$r=$dom->get_domain_all($domain);
|
||||||
$error=$err->errstr();
|
|
||||||
}
|
|
||||||
$dom->unlock();
|
$dom->unlock();
|
||||||
# 2. for each subdomain
|
# 2. for each subdomain
|
||||||
if (is_array($r['sub'])) {
|
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/
|
# 2.2 change the subdomain to redirect to http://spam.koumbit.org/
|
||||||
$dom->lock();
|
$dom->lock();
|
||||||
if (!$dom->set_sub_domain($domain, $sub, $dom->type_url, "edit", $redirect)) {
|
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();
|
$dom->unlock();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
$fields = array (
|
$fields = array (
|
||||||
|
@ -54,9 +55,7 @@ if ($synchronise==true) {
|
||||||
|
|
||||||
$quota->create_missing_quota_profile();
|
$quota->create_missing_quota_profile();
|
||||||
|
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<form method="post" action="adm_dodefquotas.php">
|
<form method="post" action="adm_dodefquotas.php">
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,10 +42,7 @@ include_once("head.php");
|
||||||
<hr id="topbar" />
|
<hr id="topbar" />
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<br/>
|
<br/>
|
||||||
<h3><?php __("List of the websites having errors in the domain database."); ?></h3>
|
<h3><?php __("List of the websites having errors in the domain database."); ?></h3>
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
$fields = array (
|
$fields = array (
|
||||||
|
@ -54,19 +55,18 @@ if ($create_dom && !empty($create_dom_list) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pass != $passconf) {
|
if ($pass != $passconf) {
|
||||||
$error = _("Passwords do not match");
|
$msg->raise("Error", "admin", _("Passwords do not match"));
|
||||||
include("adm_add.php");
|
include("adm_add.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attemp to create, exit if fail
|
// 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))) {
|
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");
|
include ("adm_add.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$error=_("The new member has been successfully created");
|
$msg->raise("Ok", "admin", _("The new member has been successfully created"));
|
||||||
|
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -32,7 +32,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
$fields = array (
|
$fields = array (
|
||||||
|
@ -45,18 +46,18 @@ getFields($fields);
|
||||||
if($action == "add") {
|
if($action == "add") {
|
||||||
|
|
||||||
if($quota->addtype($type)) {
|
if($quota->addtype($type)) {
|
||||||
$error=_("Account type"). " \"".htmlentities($type)."\" "._("added");
|
$msg->raise('Ok', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("added"));
|
||||||
} else {
|
} 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");
|
include("adm_defquotas.php");
|
||||||
} else if($action == "delete") {
|
} else if($action == "delete") {
|
||||||
if($del_confirm == "y"){
|
if($del_confirm == "y"){
|
||||||
if(!empty($type)) {
|
if(!empty($type)) {
|
||||||
if($quota->deltype($type)) {
|
if($quota->deltype($type)) {
|
||||||
$error=_("Account type"). " \"".htmlentities($type)."\" "._("deleted");
|
$msg->raise('Ok', "admin", _("Account type"). " \"".htmlentities($type)."\" "._("deleted"));
|
||||||
} else {
|
} 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");
|
include("adm_defquotas.php");
|
||||||
|
@ -92,9 +93,9 @@ if($action == "add") {
|
||||||
}
|
}
|
||||||
|
|
||||||
if($quota->setdefaults($c)) {
|
if($quota->setdefaults($c)) {
|
||||||
$error=_("Default quotas successfully changed");
|
$msg->raise('Ok', "admin", _("Default quotas successfully changed"));
|
||||||
} else {
|
} else {
|
||||||
$error=_("Default quotas could not be set.");
|
$msg->raise('Error', "admin", _("Default quotas could not be set."));
|
||||||
}
|
}
|
||||||
include("adm_panel.php");
|
include("adm_panel.php");
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,23 +42,23 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if($del_confirm == "y"){
|
if($del_confirm == "y"){
|
||||||
$error = "";
|
|
||||||
foreach ($accountList as $key => $val) {
|
foreach ($accountList as $key => $val) {
|
||||||
if (!$admin->checkcreator($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();
|
exit();
|
||||||
}
|
}
|
||||||
if (!($u=$admin->get($val)) || !$admin->del_mem($val)) {
|
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 {
|
} else {
|
||||||
$error .= sprintf(_("Member %s successfully deleted"),$u["login"])."<br />";
|
$msg->raise("Ok", "admin", _("Member %s successfully deleted"),$u["login"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
if (!is_array($accountList) || count($accountList)==0) {
|
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");
|
require("adm_list.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,12 +57,13 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if ($subadmin==0 && !$admin->checkcreator($uid)) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pass != $passconf) {
|
if ($pass != $passconf) {
|
||||||
$error = _("Passwords do not match");
|
$msg->raise("Error", "admin", _("Passwords do not match"));
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
exit();
|
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)){
|
if (!$admin->update_mem($uid, $nmail, $nom, $prenom, $pass, $enabled, $canpass, $type, $duration, $notes, $reset_quotas)){
|
||||||
$error=$err->errstr();
|
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
} else {
|
} else {
|
||||||
$error=_("The member has been successfully edited");
|
$msg->raise("Ok", "admin", _("The member has been successfully edited"));
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,11 +40,9 @@ $fields = array (
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$admin->dom_lock($domain)) {
|
$admin->dom_lock($domain);
|
||||||
$error=$err->errstr();
|
|
||||||
}
|
|
||||||
|
|
||||||
include("adm_doms.php");
|
include("adm_doms.php");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,9 +40,7 @@ include_once ("head.php");
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Manage installed domains"); ?></h3>
|
<h3><?php __("Manage installed domains"); ?></h3>
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$fields = array (
|
$fields = array (
|
||||||
"force" => array ("get", "integer", "0"),
|
"force" => array ("get", "integer", "0"),
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,11 +23,6 @@ include_once("head.php");
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$fields = array(
|
$fields = array(
|
||||||
"domup" => array("post", "array", ""),
|
"domup" => array("post", "array", ""),
|
||||||
);
|
);
|
||||||
|
@ -34,11 +30,12 @@ getFields($fields);
|
||||||
|
|
||||||
if (!empty($domup)) {
|
if (!empty($domup)) {
|
||||||
if (!$dom->update_default_subdomains($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 {
|
} else {
|
||||||
$error = _("Save done.");
|
$msg->raise('Ok', "admin", _("Save done."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo $msg->msg_html_all();
|
||||||
|
|
||||||
$tab = $dom->lst_default_subdomains();
|
$tab = $dom->lst_default_subdomains();
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,10 +44,7 @@ include_once("head.php");
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (!empty($error)) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<p>
|
<p>
|
||||||
<?php __("Here is the list of domain types."); ?>
|
<?php __("Here is the list of domain types."); ?>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,12 +21,12 @@ $fields = array (
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if ( ! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced,$create_tmpdir,$create_targetdir) ) {
|
if (! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced,$create_tmpdir,$create_targetdir) ) {
|
||||||
die($err->errstr());
|
include("adm_domstypedoedit.php");
|
||||||
} else {
|
} else {
|
||||||
|
$msg->raise('Ok', "admin", _("Domain type is updated"));
|
||||||
include("adm_domstype.php");
|
include("adm_domstype.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
*/
|
*/
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,21 +52,17 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if (! $d=$dom->domains_type_get($name)) {
|
$d=$dom->domains_type_get($name);
|
||||||
$error=$err->errstr();
|
|
||||||
echo $error;
|
|
||||||
} else {
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<h3><?php __("Edit a domain type"); ?> </h3>
|
<h3><?php __("Edit a domain type"); ?> </h3>
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error_edit) && $error_edit) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error_edit</p>";
|
|
||||||
$error_edit="";
|
|
||||||
|
|
||||||
} ?>
|
if (! $msg->has_msgs("Error")) {
|
||||||
|
?>
|
||||||
|
|
||||||
<form action="adm_domstypedoedit.php" method="post" name="main" id="main">
|
<form action="adm_domstypedoedit.php" method="post" name="main" id="main">
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,13 +12,9 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if (empty($name) || (! $dom->domains_type_regenerate($name)) ) {
|
if (! empty($name) || ($dom->domains_type_regenerate($name)) ) {
|
||||||
die($err->errstr());
|
$msg->raise('Ok', "admin", _("Regenerate pending"));
|
||||||
} else {
|
|
||||||
$error="Regenerate pending";
|
|
||||||
include("adm_domstype.php");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include("adm_domstype.php");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,14 +40,12 @@ $fields = array (
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$admin->su2normal($uid)) {
|
if ($admin->su2normal($uid)) {
|
||||||
$error=$err->errstr();
|
$msg->raise("Ok", "admin", _("This account is now a normal account"));
|
||||||
} else {
|
}
|
||||||
$error=_("This account is now a normal account");
|
|
||||||
}
|
|
||||||
|
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
|
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,15 +43,15 @@ $fields = array (
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$admin->checkcreator($uid)) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$admin->renew_mem($uid, $periods)){
|
if (!$admin->renew_mem($uid, $periods)){
|
||||||
$error=$err->errstr();
|
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
} else {
|
} else {
|
||||||
$error=_("The member has been successfully renewed");
|
$msg->raise("Ok", "admin", _("The member has been successfully renewed"));
|
||||||
include("adm_list.php");
|
include("adm_list.php");
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,14 +40,12 @@ $fields = array (
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$admin->normal2su($uid)) {
|
if ($admin->normal2su($uid)) {
|
||||||
$error=$err->errstr();
|
$msg->raise("Ok", "admin", _("This account is now an administrator account"));
|
||||||
} else {
|
|
||||||
$error=_("This account is now an administrator account");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
include("adm_edit.php");
|
include("adm_edit.php");
|
||||||
|
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -33,7 +33,8 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,22 +46,22 @@ getFields($fields);
|
||||||
$subadmin=variable_get("subadmin_restriction");
|
$subadmin=variable_get("subadmin_restriction");
|
||||||
|
|
||||||
if ($subadmin==0 && !$admin->checkcreator($uid)) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$r=$admin->get($uid)) {
|
$r=$admin->get($uid);
|
||||||
$error=$err->errstr();
|
|
||||||
}
|
$c=$admin->listPasswordPolicies();
|
||||||
|
$passwd_classcount = $c['adm']['classcount'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Member Edition"); ?></h3>
|
<h3><?php __("Member Edition"); ?></h3>
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<form method="post" action="adm_doedit.php" name="main" id="main" autocomplete="off">
|
<form method="post" action="adm_doedit.php" name="main" id="main" autocomplete="off">
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
@ -88,7 +89,7 @@ if (!$r=$admin->get($uid)) {
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><label for="pass"><?php __("Password"); ?></label></th>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<th><label for="passconf"><?php __("Confirm password"); ?></label></th>
|
<th><label for="passconf"><?php __("Confirm password"); ?></label></th>
|
||||||
|
|
|
@ -27,7 +27,8 @@ require_once("../class/config.php");
|
||||||
include("head.php");
|
include("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,16 +46,13 @@ getFields($fields);
|
||||||
|
|
||||||
if ( !empty($submit) ) {
|
if ( !empty($submit) ) {
|
||||||
if ($admin->mailallmembers($subject,$message,$from)) {
|
if ($admin->mailallmembers($subject,$message,$from)) {
|
||||||
$error=_("The email was successfully sent");
|
$msg->raise("Ok", "admin", _("The email was successfully sent"));
|
||||||
} else {
|
} else {
|
||||||
$error=_("There was an error");
|
$msg->raise("Ok", "admin", _("There was an error"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<form method="post" action="adm_email.php">
|
<form method="post" action="adm_email.php">
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
|
|
@ -28,7 +28,8 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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');
|
include_once('foot.php');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -54,7 +55,8 @@ $subadmin = variable_get("subadmin_restriction", 0);
|
||||||
// If we ask for all account but we aren't "admin" and
|
// If we ask for all account but we aren't "admin" and
|
||||||
// subadmin var is not 1
|
// subadmin var is not 1
|
||||||
if ($show == "all" && !$subadmin == 1 && $cuid != 2000) {
|
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');
|
include('foot.php');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -130,9 +132,7 @@ if ($mem->user["admlist"] == 0) { // Normal (large) mode
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (!empty($error)) {
|
echo $msg->msg_html_all();
|
||||||
echo '<p class="alert alert-danger">', $error, '</p>';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -143,7 +143,8 @@ if (!empty($error)) {
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (!is_array($accountList) || empty($accountList)) {
|
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');
|
include('foot.php');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,12 +30,13 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled || $cuid!=2000) {
|
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();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$fields = array (
|
$fields = array (
|
||||||
"action" =>array ("get","string",""),
|
"action" =>array ("get","string",""),
|
||||||
);
|
);
|
||||||
|
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
|
@ -46,14 +46,14 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) {
|
||||||
list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]);
|
list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]);
|
||||||
$newuid=intval($newuid);
|
$newuid=intval($newuid);
|
||||||
if (!$newuid) {
|
if (!$newuid) {
|
||||||
$error=_("Your authentication information are incorrect");
|
$msg->raise("Error", "admin", _("Your authentication information are incorrect"));
|
||||||
include("index.php");
|
include("index.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$admin->enabled=true;
|
$admin->enabled=true;
|
||||||
$r=$admin->get($newuid);
|
$r=$admin->get($newuid);
|
||||||
if ($passcheck!=md5($r["pass"])) {
|
if ($passcheck!=md5($r["pass"])) {
|
||||||
$error=_("Your authentication information are incorrect");
|
$msg->raise("Ok", "admin", _("Your authentication information are incorrect"));
|
||||||
include("index.php");
|
include("index.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,6 @@ if ( empty($id) && isset($_COOKIE["oldid"]) && !empty($_COOKIE["oldid"])) {
|
||||||
|
|
||||||
// And we go back to the former administrator account :
|
// And we go back to the former administrator account :
|
||||||
if (!$mem->setid($newuid)) {
|
if (!$mem->setid($newuid)) {
|
||||||
$error=$err->errstr();
|
|
||||||
include("index.php");
|
include("index.php");
|
||||||
exit();
|
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)
|
// * 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) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Depending on subadmin_restriction, a subadmin can (or cannot) connect to account he didn't create
|
// Depending on subadmin_restriction, a subadmin can (or cannot) connect to account he didn't create
|
||||||
$subadmin=variable_get("subadmin_restriction");
|
$subadmin=variable_get("subadmin_restriction");
|
||||||
if ($subadmin==0 && !$admin->checkcreator($id)) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$r=$admin->get($id)) {
|
if ($r=$admin->get($id)) {
|
||||||
$error=$err->errstr();
|
|
||||||
} else {
|
|
||||||
$oldid=$cuid."/".md5($mem->user["pass"]);
|
$oldid=$cuid."/".md5($mem->user["pass"]);
|
||||||
setcookie('oldid',$oldid,0,'/');
|
setcookie('oldid',$oldid,0,'/');
|
||||||
$_COOKIE['oldid']=$oldid;
|
$_COOKIE['oldid']=$oldid;
|
||||||
|
|
||||||
if (!$mem->setid($id)) {
|
if (!$mem->setid($id)) {
|
||||||
$error=$err->errstr();
|
|
||||||
include("index.php");
|
include("index.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -110,9 +108,7 @@ include_once("head.php");
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Member login"); ?></h3>
|
<h3><?php __("Member login"); ?></h3>
|
||||||
<?php
|
<?php
|
||||||
|
echo $msg->msg_html_all();
|
||||||
|
|
||||||
if (isset($error) && $error) {
|
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
include_once("foot.php");
|
include_once("foot.php");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,29 +45,31 @@ getFields($fields);
|
||||||
if ($delaccount) {
|
if ($delaccount) {
|
||||||
// Delete an account
|
// Delete an account
|
||||||
if ($mail->del_slave_account($delaccount)) {
|
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) {
|
if ($newlogin) {
|
||||||
// Add an account
|
// Add an account
|
||||||
if ($mail->add_slave_account($newlogin,$newpass)) {
|
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='';
|
$newlogin='';$newpass='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
|
$c=$admin->listPasswordPolicies();
|
||||||
|
$passwd_classcount = $c['adm']['classcount'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Manage allowed accounts for secondary mx"); ?></h3>
|
<h3><?php __("Manage allowed accounts for secondary mx"); ?></h3>
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$c=$mail->enum_slave_account();
|
$c=$mail->enum_slave_account();
|
||||||
|
|
||||||
|
echo $msg->msg_html_all();
|
||||||
|
|
||||||
if (is_array($c)) {
|
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><th><label for="newlogin"><?php __("Login"); ?></label></th><th><label for="newpass"><?php __("Password"); ?></label></th></tr>
|
||||||
<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="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>
|
||||||
<tr class="trbtn"><td colspan="2">
|
<tr class="trbtn"><td colspan="2">
|
||||||
<input type="submit" value="<?php __("Add this account to the allowed list"); ?>" class="inb" />
|
<input type="submit" value="<?php __("Add this account to the allowed list"); ?>" class="inb" />
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,11 +42,7 @@ include_once("head.php");
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
include_once("foot.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<ul id="adm_panel">
|
<ul id="adm_panel">
|
||||||
<li class="lst"><a href="adm_tld.php"><?php __("Manage allowed domains (TLD)"); ?></a></li>
|
<li class="lst"><a href="adm_tld.php"><?php __("Manage allowed domains (TLD)"); ?></a></li>
|
||||||
|
|
|
@ -27,7 +27,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,38 +51,34 @@ include_once("head.php");
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$c=$admin->listPasswordPolicies();
|
$c=$admin->listPasswordPolicies();
|
||||||
//echo "<pre>"; print_r($c); echo "</pre>";
|
|
||||||
|
|
||||||
if (isset($doedit) && $doedit) {
|
if (isset($doedit) && $doedit) {
|
||||||
if (!$c[$doedit]) {
|
if (!$c[$doedit]) {
|
||||||
echo "<p class=\"alert alert-danger\">"._("Policy not found")."</p>";
|
$msg->raise('Error', "admin", _("Policy not found"));
|
||||||
} else {
|
} else {
|
||||||
// Change it ;)
|
// Change it ;)
|
||||||
if ($admin->editPolicy($doedit,$minsize,$maxsize,$classcount,$allowlogin)) {
|
if ($admin->editPolicy($doedit,$minsize,$maxsize,$classcount,$allowlogin)) {
|
||||||
echo "<p class=\"info\">"._("Policy changed")."</p>";
|
$msg->raise('Ok', "admin", _("Policy changed"));
|
||||||
unset($edit);
|
unset($edit);
|
||||||
$c=$admin->listPasswordPolicies();
|
$c=$admin->listPasswordPolicies();
|
||||||
} else {
|
} 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 (!empty($edit)) {
|
||||||
if (!$c[$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 {
|
} 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">
|
<form method="post" action="adm_passpolicy.php">
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
$fields = array (
|
$fields = array (
|
||||||
|
@ -49,7 +50,10 @@ while (list($key,$val)=each($qlist)) {
|
||||||
$quota->setquota($key,$_REQUEST[$var]);
|
$quota->setquota($key,$_REQUEST[$var]);
|
||||||
}
|
}
|
||||||
$mem->unsu();
|
$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");
|
include("adm_list.php");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@ require_once("../class/config.php");
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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");
|
include_once("foot.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -41,14 +42,10 @@ $fields = array (
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
if (!$us=$admin->get($uid)) {
|
$us=$admin->get($uid);
|
||||||
$error=$err->errstr();
|
|
||||||
}
|
|
||||||
|
|
||||||
$mem->su($uid);
|
$mem->su($uid);
|
||||||
if (!$r=$quota->getquota()) {
|
$r=$quota->getquota();
|
||||||
$error=$err->errstr();
|
|
||||||
}
|
|
||||||
$mem->unsu();
|
$mem->unsu();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -56,11 +53,7 @@ $mem->unsu();
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
include_once("foot.php");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<form method="post" action="adm_quotadoedit.php">
|
<form method="post" action="adm_quotadoedit.php">
|
||||||
<?php csrf_get(); ?>
|
<?php csrf_get(); ?>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,13 +49,13 @@ getFields($fields);
|
||||||
if ($delaccount) {
|
if ($delaccount) {
|
||||||
// Delete an account
|
// Delete an account
|
||||||
if ($dom->del_slave_account($delaccount)) {
|
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) {
|
if ($newlogin) {
|
||||||
// Add an account
|
// Add an account
|
||||||
if ($dom->add_slave_account($newlogin,$newpass)) {
|
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);
|
unset($newlogin); unset($newpass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,22 +63,21 @@ if ($newlogin) {
|
||||||
if ($delip) {
|
if ($delip) {
|
||||||
// Delete an ip address/class
|
// Delete an ip address/class
|
||||||
if ($dom->del_slave_ip($delip)) {
|
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) {
|
if ($newip) {
|
||||||
// Add an ip address/class
|
// Add an ip address/class
|
||||||
if ($dom->add_slave_ip($newip,$newclass)) {
|
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);
|
unset($newip); unset($newclass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once("head.php");
|
include_once("head.php");
|
||||||
|
|
||||||
if (!empty($error)) {
|
$c=$admin->listPasswordPolicies();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
$passwd_classcount = $c['adm']['classcount'];
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Manage allowed ip for slave zone transfers"); ?></h3>
|
<h3><?php __("Manage allowed ip for slave zone transfers"); ?></h3>
|
||||||
|
@ -86,6 +86,8 @@ if (!empty($error)) {
|
||||||
|
|
||||||
$c=$dom->enum_slave_ip();
|
$c=$dom->enum_slave_ip();
|
||||||
|
|
||||||
|
echo $msg->msg_html_all();
|
||||||
|
|
||||||
if (is_array($c)) { ?>
|
if (is_array($c)) { ?>
|
||||||
<p>
|
<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)"); ?>
|
<?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><th><label for="newlogin"><?php __("Login"); ?></label></th><th><label for="newpass"><?php __("Password"); ?></label></th></tr>
|
||||||
<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="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>
|
||||||
<tr class="trbtn"><td colspan="2"><input type="submit" value="<?php __("Add this account to the allowed list"); ?>" class="inb" /></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>
|
</table>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,13 +42,13 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if (is_array($sel)) {
|
if (is_array($sel)) {
|
||||||
$error="";
|
|
||||||
for($i=0;$i<count($sel);$i++) {
|
for($i=0;$i<count($sel);$i++) {
|
||||||
if (!$admin->deltld($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");
|
include_once("head.php");
|
||||||
|
@ -57,9 +58,7 @@ include_once("head.php");
|
||||||
<hr id="topbar" />
|
<hr id="topbar" />
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$c=$admin->listtld();
|
$c=$admin->listtld();
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
$fields = array (
|
$fields = array (
|
||||||
|
@ -47,11 +48,7 @@ include_once ("head.php");
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Add a new TLD"); ?></h3>
|
<h3><?php __("Add a new TLD"); ?></h3>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,11 +43,10 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if (!$admin->addtld($tld,$mode)) {
|
if (!$admin->addtld($tld,$mode)) {
|
||||||
$error=$err->errstr();
|
|
||||||
include("adm_tldadd.php");
|
include("adm_tldadd.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$error=_("The TLD has been successfully added");
|
$msg->raise("Ok", "admin", _("The TLD has been successfully added"));
|
||||||
include("adm_tld.php");
|
include("adm_tld.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,16 +36,16 @@ getFields($fields);
|
||||||
|
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$admin->edittld($tld,$mode)) {
|
if (!$admin->edittld($tld,$mode)) {
|
||||||
$error=$err->errstr();
|
|
||||||
include("adm_tldedit.php");
|
include("adm_tldedit.php");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$error=_("The TLD has been successfully edited");
|
$msg->raise("Ok", "admin", _("The TLD has been successfully edited"));
|
||||||
include("adm_tld.php");
|
include("adm_tld.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +42,6 @@ getFields($fields);
|
||||||
|
|
||||||
$mode=$admin->gettld($tld);
|
$mode=$admin->gettld($tld);
|
||||||
if ($mode===false) {
|
if ($mode===false) {
|
||||||
$error=$err->errstr();
|
|
||||||
include("adm_tld.php");
|
include("adm_tld.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,7 @@ include_once("head.php");
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
if (isset($error) && $error) {
|
echo $msg->msg_html_all();
|
||||||
echo "<p class=\"alert alert-danger\">$error</p>";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<h3><?php __("Edit a TLD"); ?></h3>
|
<h3><?php __("Edit a TLD"); ?></h3>
|
||||||
|
|
||||||
|
|
|
@ -31,13 +31,15 @@ require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
if (!$admin->enabled) {
|
||||||
if ( ! ( $isinvited && isset($oldid) && !empty($oldid) && $oldid==2000) ) { // Allow sub admins
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($L_INOTIFY_UPDATE_DOMAIN)) {
|
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();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
require_once("../class/config.php");
|
require_once("../class/config.php");
|
||||||
|
|
||||||
if (!$admin->enabled) {
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ include_once ("head.php");
|
||||||
<h3><?php __("Configure AlternC variables"); ?></h3>
|
<h3><?php __("Configure AlternC variables"); ?></h3>
|
||||||
<hr id="topbar"/>
|
<hr id="topbar"/>
|
||||||
<br />
|
<br />
|
||||||
|
<?php echo $msg->msg_html_all(); ?>
|
||||||
<p>
|
<p>
|
||||||
<?php __("Here are the internal AlternC variables that are currently being used."); ?>
|
<?php __("Here are the internal AlternC variables that are currently being used."); ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -140,6 +140,15 @@ class m_admin {
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Password kind used in this class (hook for admin class)
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function alternc_password_policy() {
|
||||||
|
return array("adm" => "Administration section");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -191,7 +200,7 @@ class m_admin {
|
||||||
* <code>membres</code> et <code>local</code>)
|
* <code>membres</code> et <code>local</code>)
|
||||||
* Ckecks if the account is super-admin
|
* Ckecks if the account is super-admin
|
||||||
*
|
*
|
||||||
* @global type $err
|
* @global type $msg
|
||||||
* @global type $db
|
* @global type $db
|
||||||
* @global string $lst_users_properties
|
* @global string $lst_users_properties
|
||||||
* @param int $uid a unique integer identifying the account
|
* @param int $uid a unique integer identifying the account
|
||||||
|
@ -201,10 +210,10 @@ class m_admin {
|
||||||
* Returns FALSE if an error occurs.
|
* Returns FALSE if an error occurs.
|
||||||
*/
|
*/
|
||||||
function get($uid, $recheck = false) {
|
function get($uid, $recheck = false) {
|
||||||
global $err, $db, $lst_users_properties;
|
global $msg, $db, $lst_users_properties;
|
||||||
// $err->log("admin","get",$uid);
|
// $msg->log("admin","get",$uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,7 +247,7 @@ class m_admin {
|
||||||
// don't exist, but is not a forced check. Do a forced check
|
// don't exist, but is not a forced check. Do a forced check
|
||||||
return $this->get($uid, true);
|
return $this->get($uid, true);
|
||||||
}
|
}
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,16 +259,16 @@ class m_admin {
|
||||||
*
|
*
|
||||||
* Similar to get_list() but for creators/resellers.
|
* Similar to get_list() but for creators/resellers.
|
||||||
*
|
*
|
||||||
* @global type $err
|
* @global type $msg
|
||||||
* @global type $db
|
* @global type $db
|
||||||
* @param int $uid
|
* @param int $uid
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function get_creator($uid) {
|
function get_creator($uid) {
|
||||||
global $err, $db;
|
global $msg, $db;
|
||||||
// $err->log("admin","get",$uid);
|
// $msg->log("admin","get",$uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,7 +278,7 @@ class m_admin {
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
$c = $db->Record;
|
$c = $db->Record;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +326,7 @@ class m_admin {
|
||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
* @global type $err
|
* @global type $msg
|
||||||
* @global type $mem
|
* @global type $mem
|
||||||
* @global type $cuid
|
* @global type $cuid
|
||||||
* @param integer $all
|
* @param integer $all
|
||||||
|
@ -329,10 +338,10 @@ class m_admin {
|
||||||
* Returns FALSE if an error occurs.
|
* Returns FALSE if an error occurs.
|
||||||
*/
|
*/
|
||||||
function get_list($all = 0, $creator = 0, $pattern = FALSE, $pattern_type = FALSE) {
|
function get_list($all = 0, $creator = 0, $pattern = FALSE, $pattern_type = FALSE) {
|
||||||
global $err, $mem, $cuid;
|
global $msg, $mem, $cuid;
|
||||||
$err->log("admin", "get_list");
|
$msg->log("admin", "get_list");
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
|
@ -370,7 +379,7 @@ class m_admin {
|
||||||
}
|
}
|
||||||
$request .= ' ORDER BY login;';
|
$request .= ' ORDER BY login;';
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", _("Invalid pattern type provided. Are you even performing a legitimate action?"));
|
$msg->raise('Error', "admin", _("Invalid pattern type provided. Are you even performing a legitimate action?"));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -400,7 +409,7 @@ class m_admin {
|
||||||
/**
|
/**
|
||||||
* Send an email to all AlternC's accounts
|
* Send an email to all AlternC's accounts
|
||||||
*
|
*
|
||||||
* @global type $err
|
* @global type $msg
|
||||||
* @global type $mem
|
* @global type $mem
|
||||||
* @global type $cuid
|
* @global type $cuid
|
||||||
* @global type $db
|
* @global type $db
|
||||||
|
@ -410,10 +419,10 @@ class m_admin {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function mailallmembers($subject, $message, $from) {
|
function mailallmembers($subject, $message, $from) {
|
||||||
global $err, $db;
|
global $msg, $db;
|
||||||
$err->log("admin", "mailallmembers");
|
$msg->log("admin", "mailallmembers");
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$subject = trim($subject);
|
$subject = trim($subject);
|
||||||
|
@ -421,12 +430,12 @@ class m_admin {
|
||||||
$from = trim($from);
|
$from = trim($from);
|
||||||
|
|
||||||
if (empty($subject) || empty($message) || empty($from)) {
|
if (empty($subject) || empty($message) || empty($from)) {
|
||||||
$err->raise("admin", _("Subject, message and sender are mandatory"));
|
$msg->raise('Error', "admin", _("Subject, message and sender are mandatory"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//@todo remove cf functions.php
|
//@todo remove cf functions.php
|
||||||
if (checkmail($from) != 0) {
|
if (checkmail($from) != 0) {
|
||||||
$err->raise("admin", _("Sender is syntaxically incorrect"));
|
$msg->raise('Error', "admin", _("Sender is syntaxically incorrect"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,19 +455,19 @@ class m_admin {
|
||||||
* May only be called by the admin account (2000)
|
* May only be called by the admin account (2000)
|
||||||
* If there are no reseller accounts, returns an empty array.
|
* If there are no reseller accounts, returns an empty array.
|
||||||
*
|
*
|
||||||
* @global type $err
|
* @global type $msg
|
||||||
* @global type $mem
|
* @global type $mem
|
||||||
* @global type $cuid
|
* @global type $cuid
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function get_creator_list() {
|
function get_creator_list() {
|
||||||
global $err, $cuid;
|
global $msg, $cuid;
|
||||||
|
|
||||||
$creators = array();
|
$creators = array();
|
||||||
|
|
||||||
$err->log("admin", "get_reseller_list");
|
$msg->log("admin", "get_reseller_list");
|
||||||
if (!$this->enabled || $cuid != 2000) {
|
if (!$this->enabled || $cuid != 2000) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +488,7 @@ class m_admin {
|
||||||
/**
|
/**
|
||||||
* Check if I am the creator of the member $uid
|
* Check if I am the creator of the member $uid
|
||||||
*
|
*
|
||||||
* @global type $err
|
* @global type $msg
|
||||||
* @global type $mem
|
* @global type $mem
|
||||||
* @global type $db
|
* @global type $db
|
||||||
* @global type $cuid
|
* @global type $cuid
|
||||||
|
@ -487,14 +496,14 @@ class m_admin {
|
||||||
* @return boolean TRUE if I am the creator of that account. FALSE else.
|
* @return boolean TRUE if I am the creator of that account. FALSE else.
|
||||||
*/
|
*/
|
||||||
function checkcreator($uid) {
|
function checkcreator($uid) {
|
||||||
global $err, $db, $cuid;
|
global $msg, $db, $cuid;
|
||||||
if ($cuid == 2000) {
|
if ($cuid == 2000) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$db->query("SELECT creator FROM membres WHERE uid= ?;", array($uid));
|
$db->query("SELECT creator FROM membres WHERE uid= ?;", array($uid));
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
if ($db->Record["creator"] != $cuid) {
|
if ($db->Record["creator"] != $cuid) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -504,7 +513,7 @@ class m_admin {
|
||||||
* When the admin want to delegate a subdomain to an account
|
* When the admin want to delegate a subdomain to an account
|
||||||
*
|
*
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_dom $dom
|
* @global m_dom $dom
|
||||||
* @global m_mem $mem
|
* @global m_mem $mem
|
||||||
* @global int $cuid
|
* @global int $cuid
|
||||||
|
@ -513,18 +522,18 @@ class m_admin {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function add_shared_domain($u, $domain_name) {
|
function add_shared_domain($u, $domain_name) {
|
||||||
global $err, $dom, $mem;
|
global $msg, $dom, $mem;
|
||||||
$err->log("admin", "add_shared_domain", $u . "/" . $domain_name);
|
$msg->log("admin", "add_shared_domain", $u . "/" . $domain_name);
|
||||||
|
|
||||||
if (!$mem->checkright()) {
|
if (!$mem->checkright()) {
|
||||||
$err->raise("admin", _("-- Only administrators can do that! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can do that! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if this domain exist on this admin account
|
// Check if this domain exist on this admin account
|
||||||
if ((!in_array($domain_name, $dom->enum_domains()))&&($domaine_name!=variable_get("hosting_tld"))) {
|
if ((!in_array($domain_name, $dom->enum_domains()))&&($domaine_name!=variable_get("hosting_tld"))) {
|
||||||
$err->raise("admin", _("You don't seem to be allowed to delegate this domain"));
|
$msg->raise('Error', "admin", _("You don't seem to be allowed to delegate this domain"));
|
||||||
$err->log("admin", "add_shared_domain", "domain not allowed");
|
$msg->log("admin", "add_shared_domain", "domain not allowed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -551,7 +560,7 @@ class m_admin {
|
||||||
* the account $mid is not super-admin.
|
* the account $mid is not super-admin.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_quota $quota
|
* @global m_quota $quota
|
||||||
* @global array $classes
|
* @global array $classes
|
||||||
* @global int $cuid
|
* @global int $cuid
|
||||||
|
@ -576,46 +585,46 @@ class m_admin {
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
||||||
*/
|
*/
|
||||||
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass = 1, $type = 'default', $duration = 0, $notes = "", $force = 0, $create_dom = '', $db_server_id) {
|
function add_mem($login, $pass, $nom, $prenom, $mail, $canpass = 1, $type = 'default', $duration = 0, $notes = "", $force = 0, $create_dom = '', $db_server_id) {
|
||||||
global $err, $cuid, $mem, $L_MYSQL_DATABASE, $L_MYSQL_LOGIN, $hooks, $action;
|
global $msg, $cuid, $mem, $L_MYSQL_DATABASE, $L_MYSQL_LOGIN, $hooks, $action;
|
||||||
$err->log("admin", "add_mem", $login . "/" . $mail);
|
$msg->log("admin", "add_mem", $login . "/" . $mail);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (empty($db_server_id)) {
|
if (empty($db_server_id)) {
|
||||||
$err->raise("admin", _("Missing db_server field"));
|
$msg->raise('Error', "admin", _("Missing db_server field"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (($login == "") || ($pass == "")) {
|
if (($login == "") || ($pass == "")) {
|
||||||
$err->raise("admin", _("Please fill all mandatory fields"));
|
$msg->raise('Error', "admin", _("Please fill all mandatory fields"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!$force) {
|
if (!$force) {
|
||||||
if ($mail == "") {
|
if ($mail == "") {
|
||||||
$err->raise("admin", _("Please fill all mandatory fields"));
|
$msg->raise('Error', "admin", _("Please fill all mandatory fields"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//@todo remove cf functions.php
|
//@todo remove cf functions.php
|
||||||
if (checkmail($mail) != 0) {
|
if (checkmail($mail) != 0) {
|
||||||
$err->raise("admin", _("Please enter a valid email address"));
|
$msg->raise('Error', "admin", _("Please enter a valid email address"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$login = strtolower($login);
|
$login = strtolower($login);
|
||||||
if (!preg_match("#^[a-z0-9]+$#", $login)) { //$
|
if (!preg_match("#^[a-z0-9]+$#", $login)) { //$
|
||||||
$err->raise("admin", _("Login can only contains characters a-z and 0-9"));
|
$msg->raise('Error', "admin", _("Login can only contains characters a-z and 0-9"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (strlen($login) > 14) {
|
if (strlen($login) > 14) {
|
||||||
// Not an arbitrary value : MySQL user names can be up to 16 characters long
|
// Not an arbitrary value : MySQL user names can be up to 16 characters long
|
||||||
// If we want to allow people to create a few mysql_user (and we want to!)
|
// If we want to allow people to create a few mysql_user (and we want to!)
|
||||||
// we have to limit the login lenght
|
// we have to limit the login lenght
|
||||||
$err->raise("admin", _("The login is too long (14 chars max)"));
|
$msg->raise('Error', "admin", _("The login is too long (14 chars max)"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Some login are not allowed...
|
// Some login are not allowed...
|
||||||
if ($login == $L_MYSQL_DATABASE || $login == $L_MYSQL_LOGIN || $login == "mysql" || $login == "root") {
|
if ($login == $L_MYSQL_DATABASE || $login == $L_MYSQL_LOGIN || $login == "mysql" || $login == "root") {
|
||||||
$err->raise("admin", _("Login can only contains characters a-z, 0-9 and -"));
|
$msg->raise('Error', "admin", _("Login can only contains characters a-z, 0-9 and -"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$pass = _md5cr($pass);
|
$pass = _md5cr($pass);
|
||||||
|
@ -654,7 +663,7 @@ class m_admin {
|
||||||
|
|
||||||
return $uid;
|
return $uid;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", _("This login already exists"));
|
$msg->raise('Error', "admin", _("This login already exists"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -663,21 +672,21 @@ class m_admin {
|
||||||
* AlternC's standard function called when a user is created
|
* AlternC's standard function called when a user is created
|
||||||
* This sends an email if configured through the interface.
|
* This sends an email if configured through the interface.
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global int $cuid
|
* @global int $cuid
|
||||||
* @global string $L_FQDN
|
* @global string $L_FQDN
|
||||||
* @global string $L_HOSTING
|
* @global string $L_HOSTING
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function hook_admin_add_member() {
|
function hook_admin_add_member() {
|
||||||
global $err, $cuid, $L_FQDN, $L_HOSTING;
|
global $msg, $cuid, $L_FQDN, $L_HOSTING;
|
||||||
$dest = variable_get('new_email', '0', 'An email will be sent to this address when new accounts are created if set.', array('desc' => 'Enabled', 'type' => 'boolean'));
|
$dest = variable_get('new_email', '0', 'An email will be sent to this address when new accounts are created if set.', array('desc' => 'Enabled', 'type' => 'boolean'));
|
||||||
if (!$dest) {
|
if (!$dest) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
if (!$db->query("SELECT m.*, parent.login as parentlogin FROM membres m LEFT JOIN membres parent ON parent.uid=m.creator WHERE m.uid= ?", array($cuid))) {
|
if (!$db->query("SELECT m.*, parent.login as parentlogin FROM membres m LEFT JOIN membres parent ON parent.uid=m.creator WHERE m.uid= ?", array($cuid))) {
|
||||||
$err->raise("admin", sprintf(_("query failed: %s "), $db->Error));
|
$msg->raise('Error', "admin", sprintf(_("query failed: %s "), $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($db->next_record()) {
|
if ($db->next_record()) {
|
||||||
|
@ -709,11 +718,11 @@ EOF;
|
||||||
//sprintf(_("Email successfully sent to %s"), $dest);
|
//sprintf(_("Email successfully sent to %s"), $dest);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", sprintf(_("Cannot send email to %s"), $dest));
|
$msg->raise('Error', "admin", sprintf(_("Cannot send email to %s"), $dest));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", sprintf(_("Query failed: %s"), $db->Error));
|
$msg->raise('Error', "admin", sprintf(_("Query failed: %s"), $db->Error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -725,7 +734,7 @@ EOF;
|
||||||
* and <code>local</code>). Prevents any manipulation of the account if
|
* and <code>local</code>). Prevents any manipulation of the account if
|
||||||
* the account $mid is not super-admin.
|
* the account $mid is not super-admin.
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @global int $cuid
|
* @global int $cuid
|
||||||
* @global m_quota $quota
|
* @global m_quota $quota
|
||||||
|
@ -743,12 +752,12 @@ EOF;
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not
|
* @return boolean Returns FALSE if an error occurs, TRUE if not
|
||||||
*/
|
*/
|
||||||
function update_mem($uid, $mail, $nom, $prenom, $pass, $enabled, $canpass, $type = 'default', $duration = 0, $notes = "", $reset_quotas = false) {
|
function update_mem($uid, $mail, $nom, $prenom, $pass, $enabled, $canpass, $type = 'default', $duration = 0, $notes = "", $reset_quotas = false) {
|
||||||
global $err, $db, $quota;
|
global $msg, $db, $quota;
|
||||||
|
|
||||||
$err->log("admin", "update_mem", $uid);
|
$msg->log("admin", "update_mem", $uid);
|
||||||
|
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
|
@ -775,7 +784,7 @@ EOF;
|
||||||
$this->renew_update($uid, $duration);
|
$this->renew_update($uid, $duration);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -785,23 +794,23 @@ EOF;
|
||||||
*
|
*
|
||||||
* Lock an account and prevent the user to access its account.
|
* Lock an account and prevent the user to access its account.
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @param int $uid The uid number of the account
|
* @param int $uid The uid number of the account
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
||||||
*/
|
*/
|
||||||
function lock_mem($uid) {
|
function lock_mem($uid) {
|
||||||
global $err, $db;
|
global $msg, $db;
|
||||||
$err->log("admin", "lock_mem", $uid);
|
$msg->log("admin", "lock_mem", $uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
if ($db->query("UPDATE membres SET enabled='0' WHERE uid= ?;", array($uid))) {
|
if ($db->query("UPDATE membres SET enabled='0' WHERE uid= ?;", array($uid))) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -812,23 +821,23 @@ EOF;
|
||||||
* UnLock an account and prevent the user to access its account.
|
* UnLock an account and prevent the user to access its account.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @param int $uid The uid number of the account
|
* @param int $uid The uid number of the account
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
||||||
*/
|
*/
|
||||||
function unlock_mem($uid) {
|
function unlock_mem($uid) {
|
||||||
global $err, $db;
|
global $msg, $db;
|
||||||
$err->log("admin", "unlock_mem", $uid);
|
$msg->log("admin", "unlock_mem", $uid);
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
if ($db->query("UPDATE membres SET enabled='1' WHERE uid= ?;", array($uid))) {
|
if ($db->query("UPDATE membres SET enabled='1' WHERE uid= ?;", array($uid))) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -839,7 +848,7 @@ EOF;
|
||||||
* Deletes the specified account. Prevents any manipulation of the account if
|
* Deletes the specified account. Prevents any manipulation of the account if
|
||||||
* the account $mid is not super-admin.
|
* the account $mid is not super-admin.
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_quota $quota
|
* @global m_quota $quota
|
||||||
* @global array $classes
|
* @global array $classes
|
||||||
* @global int $cuid
|
* @global int $cuid
|
||||||
|
@ -851,11 +860,11 @@ EOF;
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
||||||
*/
|
*/
|
||||||
function del_mem($uid) {
|
function del_mem($uid) {
|
||||||
global $err, $mem, $dom, $hooks, $action;
|
global $msg, $mem, $dom, $hooks, $action;
|
||||||
$err->log("admin", "del_mem", $uid);
|
$msg->log("admin", "del_mem", $uid);
|
||||||
|
|
||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
$err->raise("admin", _("-- Only administrators can access this page! --"));
|
$msg->raise('Error', "admin", _("-- Only administrators can access this page! --"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db = new DB_System();
|
$db = new DB_System();
|
||||||
|
@ -865,7 +874,7 @@ EOF;
|
||||||
// This script may take a long time on big accounts, let's give us some time ... Fixes 1132
|
// This script may take a long time on big accounts, let's give us some time ... Fixes 1132
|
||||||
@set_time_limit(0);
|
@set_time_limit(0);
|
||||||
// WE MUST call m_dom before all others because of conflicts ...
|
// WE MUST call m_dom before all others because of conflicts ...
|
||||||
$dom->hook_admin_del_member();
|
$dom->admin_del_member();
|
||||||
|
|
||||||
# New way of deleting or backup delted user html folders using action class
|
# New way of deleting or backup delted user html folders using action class
|
||||||
$path = getuserpath($tt['login']);
|
$path = getuserpath($tt['login']);
|
||||||
|
@ -881,7 +890,7 @@ EOF;
|
||||||
$db->query("UPDATE membres SET creator=2000 WHERE creator= ?;", array($uid));
|
$db->query("UPDATE membres SET creator=2000 WHERE creator= ?;", array($uid));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
$mem->unsu();
|
$mem->unsu();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -892,14 +901,14 @@ EOF;
|
||||||
*
|
*
|
||||||
* Renew an account for its duration
|
* Renew an account for its duration
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @param int $uid The uid number of the account
|
* @param int $uid The uid number of the account
|
||||||
* @param int $periods The new duration, in months, of the account
|
* @param int $periods The new duration, in months, of the account
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
||||||
*/
|
*/
|
||||||
function renew_mem($uid, $periods = 1) {
|
function renew_mem($uid, $periods = 1) {
|
||||||
global $err, $db;
|
global $msg, $db;
|
||||||
|
|
||||||
$periods = intval($periods);
|
$periods = intval($periods);
|
||||||
if ($periods == 0) {
|
if ($periods == 0) {
|
||||||
|
@ -908,7 +917,7 @@ EOF;
|
||||||
if ($db->query("UPDATE membres SET renewed = renewed + INTERVAL (duration * ?) MONTH WHERE uid= ?;", array($periods, $uid))) {
|
if ($db->query("UPDATE membres SET renewed = renewed + INTERVAL (duration * ?) MONTH WHERE uid= ?;", array($periods, $uid))) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -916,14 +925,14 @@ EOF;
|
||||||
/**
|
/**
|
||||||
* Update the duration information for an account
|
* Update the duration information for an account
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @param int $uid The uid number of the account
|
* @param int $uid The uid number of the account
|
||||||
* @param int $duration The new duration, in months, of the account
|
* @param int $duration The new duration, in months, of the account
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
||||||
*/
|
*/
|
||||||
function renew_update($uid, $duration) {
|
function renew_update($uid, $duration) {
|
||||||
global $err, $db;
|
global $msg, $db;
|
||||||
|
|
||||||
if ($duration == 0) {
|
if ($duration == 0) {
|
||||||
if ($db->query("UPDATE membres SET duration = NULL, renewed = NULL WHERE uid= ?;", array($uid))) {
|
if ($db->query("UPDATE membres SET duration = NULL, renewed = NULL WHERE uid= ?;", array($uid))) {
|
||||||
|
@ -936,7 +945,7 @@ EOF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1005,20 +1014,20 @@ EOF;
|
||||||
/**
|
/**
|
||||||
* Turns a common account into a super-admin account
|
* Turns a common account into a super-admin account
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @param int $uid The uid number of the account
|
* @param int $uid The uid number of the account
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function normal2su($uid) {
|
function normal2su($uid) {
|
||||||
global $err, $db;
|
global $msg, $db;
|
||||||
$db->query("SELECT su FROM membres WHERE uid= ?;", array($uid));
|
$db->query("SELECT su FROM membres WHERE uid= ?;", array($uid));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($db->Record["su"] != 0) {
|
if ($db->Record["su"] != 0) {
|
||||||
$err->raise("admin", _("This account is ALREADY an administrator account"));
|
$msg->raise('Error', "admin", _("This account is ALREADY an administrator account"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("UPDATE membres SET su=1 WHERE uid= ?;", array($uid));
|
$db->query("UPDATE membres SET su=1 WHERE uid= ?;", array($uid));
|
||||||
|
@ -1028,20 +1037,20 @@ EOF;
|
||||||
/**
|
/**
|
||||||
* Turns a super-admin account into a common account
|
* Turns a super-admin account into a common account
|
||||||
*
|
*
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @param int $uid The uid number of the account
|
* @param int $uid The uid number of the account
|
||||||
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
* @return boolean Returns FALSE if an error occurs, TRUE if not.
|
||||||
*/
|
*/
|
||||||
function su2normal($uid) {
|
function su2normal($uid) {
|
||||||
global $err, $db;
|
global $msg, $db;
|
||||||
$db->query("SELECT su FROM membres WHERE uid= ?;", array($uid));
|
$db->query("SELECT su FROM membres WHERE uid= ?;", array($uid));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$err->raise("admin", _("Account not found"));
|
$msg->raise('Error', "admin", _("Account not found"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($db->Record["su"] != 1) {
|
if ($db->Record["su"] != 1) {
|
||||||
$err->raise("admin", _("This account is NOT an administrator account!"));
|
$msg->raise('Error', "admin", _("This account is NOT an administrator account!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("UPDATE membres SET su=0 WHERE uid= ?;", array($uid));
|
$db->query("UPDATE membres SET su=0 WHERE uid= ?;", array($uid));
|
||||||
|
@ -1219,15 +1228,15 @@ EOF;
|
||||||
* from its account
|
* from its account
|
||||||
*
|
*
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @param string $domain Domain name to lock / unlock
|
* @param string $domain Domain name to lock / unlock
|
||||||
* @return boolean TRUE if the domain has been locked/unlocked or FALSE if it does not exist.
|
* @return boolean TRUE if the domain has been locked/unlocked or FALSE if it does not exist.
|
||||||
*/
|
*/
|
||||||
function dom_lock($domain) {
|
function dom_lock($domain) {
|
||||||
global $db, $err;
|
global $db, $msg;
|
||||||
$db->query("SELECT compte FROM domaines WHERE domaine= ?;", array($domain));
|
$db->query("SELECT compte FROM domaines WHERE domaine= ?;", array($domain));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$err->raise("dom", _("Domain '%s' not found."), $domain);
|
$msg->raise('Error', "dom", _("Domain '%s' not found."), $domain);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("UPDATE domaines SET noerase=1-noerase WHERE domaine= ?;", array($domain));
|
$db->query("UPDATE domaines SET noerase=1-noerase WHERE domaine= ?;", array($domain));
|
||||||
|
@ -1238,15 +1247,15 @@ EOF;
|
||||||
* Add a new TLD to the list of the authorized TLDs
|
* Add a new TLD to the list of the authorized TLDs
|
||||||
*
|
*
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @param string $tld top-level domain to add (org, com...)
|
* @param string $tld top-level domain to add (org, com...)
|
||||||
* @return boolean TRUE if the tld has been successfully added, FALSE if not.
|
* @return boolean TRUE if the tld has been successfully added, FALSE if not.
|
||||||
*/
|
*/
|
||||||
function gettld($tld) {
|
function gettld($tld) {
|
||||||
global $db, $err;
|
global $db, $msg;
|
||||||
$db->query("SELECT mode FROM tld WHERE tld= ?;", array($tld));
|
$db->query("SELECT mode FROM tld WHERE tld= ?;", array($tld));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$err->raise("admin", _("This TLD does not exist"));
|
$msg->raise('Error', "admin", _("This TLD does not exist"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $db->Record["mode"];
|
return $db->Record["mode"];
|
||||||
|
@ -1273,16 +1282,16 @@ EOF;
|
||||||
* on this TLD
|
* on this TLD
|
||||||
*
|
*
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @param string $tld The TLD you want to delete
|
* @param string $tld The TLD you want to delete
|
||||||
* @return boolean returns true if the TLD has been deleted, or
|
* @return boolean returns true if the TLD has been deleted, or
|
||||||
* false if an error occured.
|
* false if an error occured.
|
||||||
*/
|
*/
|
||||||
function deltld($tld) {
|
function deltld($tld) {
|
||||||
global $db, $err;
|
global $db, $msg;
|
||||||
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$err->raise("admin", _("This TLD does not exist"));
|
$msg->raise('Error', "admin", _("This TLD does not exist"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$db->query("DELETE FROM tld WHERE tld= ?;", array($tld));
|
$db->query("DELETE FROM tld WHERE tld= ?;", array($tld));
|
||||||
|
@ -1298,23 +1307,23 @@ EOF;
|
||||||
* domain!
|
* domain!
|
||||||
*
|
*
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @param string $tld string TLD we want to authorize
|
* @param string $tld string TLD we want to authorize
|
||||||
* @param boolean $mode Controls to make on this TLD.
|
* @param boolean $mode Controls to make on this TLD.
|
||||||
* @return boolean TRUE if the TLD has been successfully
|
* @return boolean TRUE if the TLD has been successfully
|
||||||
* added. FALSE if not.
|
* added. FALSE if not.
|
||||||
*/
|
*/
|
||||||
function addtld($tld, $mode) {
|
function addtld($tld, $mode) {
|
||||||
global $db, $err;
|
global $db, $msg;
|
||||||
if (!$tld) {
|
if (!$tld) {
|
||||||
$err->raise("admin", _("The TLD name is mandatory"));
|
$msg->raise('Error', "admin", _("The TLD name is mandatory"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$tld = trim($tld);
|
$tld = trim($tld);
|
||||||
|
|
||||||
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
||||||
if ($db->next_record()) {
|
if ($db->next_record()) {
|
||||||
$err->raise("admin", _("This TLD already exist"));
|
$msg->raise('Error', "admin", _("This TLD already exist"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (substr($tld, 0, 1) == ".") {
|
if (substr($tld, 0, 1) == ".") {
|
||||||
|
@ -1332,7 +1341,7 @@ EOF;
|
||||||
* Modify a TLD of the list of the authorized TLDs
|
* Modify a TLD of the list of the authorized TLDs
|
||||||
*
|
*
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @param string $tld TLD we want to modify
|
* @param string $tld TLD we want to modify
|
||||||
* @param int $mode Controls to make on this TLD.
|
* @param int $mode Controls to make on this TLD.
|
||||||
* @return boolean TRUE if the TLD has been successfully
|
* @return boolean TRUE if the TLD has been successfully
|
||||||
|
@ -1340,10 +1349,10 @@ EOF;
|
||||||
|
|
||||||
*/
|
*/
|
||||||
function edittld($tld, $mode) {
|
function edittld($tld, $mode) {
|
||||||
global $db, $err;
|
global $db, $msg;
|
||||||
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
$db->query("SELECT tld FROM tld WHERE tld= ?;", array($tld));
|
||||||
if (!$db->next_record()) {
|
if (!$db->next_record()) {
|
||||||
$err->raise("admin", _("This TLD does not exist"));
|
$msg->raise('Error', "admin", _("This TLD does not exist"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$mode = intval($mode);
|
$mode = intval($mode);
|
||||||
|
@ -1442,40 +1451,40 @@ EOF;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @global m_mysql $db
|
* @global m_mysql $db
|
||||||
* @global m_err $err
|
* @global m_messages $msg
|
||||||
* @param string $policy Name of the policy to check for
|
* @param string $policy Name of the policy to check for
|
||||||
* @param string $login The login that will be set
|
* @param string $login The login that will be set
|
||||||
* @param string $password The password we have to check
|
* @param string $password The password we have to check
|
||||||
* @return boolean TRUE if the password if OK for this login and this policy, FALSE if it is not.
|
* @return boolean TRUE if the password if OK for this login and this policy, FALSE if it is not.
|
||||||
*/
|
*/
|
||||||
function checkPolicy($policy, $login, $password) {
|
function checkPolicy($policy, $login, $password, $canbeempty = false) {
|
||||||
global $err;
|
global $msg;
|
||||||
|
|
||||||
if (empty($login)) {
|
if (empty($login)) {
|
||||||
$err->raise("admin", _("Please enter a login"));
|
$msg->raise('alert', "admin", _("Please enter a login"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (empty($password)) {
|
if (empty($password) && !$canbeempty) {
|
||||||
$err->raise("admin", _("Please enter a password"));
|
$msg->raise('alert', "admin", _("Please enter a password"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pol = $this->listPasswordPolicies();
|
$pol = $this->listPasswordPolicies();
|
||||||
if (!$pol[$policy]) {
|
if (!$pol[$policy]) {
|
||||||
$err->raise("admin", _("-- Program error -- The requested password policy does not exist!"));
|
$msg->raise('Error', "admin", _("-- Program error -- The requested password policy does not exist!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$pol = $pol[$policy];
|
$pol = $pol[$policy];
|
||||||
// Ok, now let's check it :
|
// Ok, now let's check it :
|
||||||
$plen = strlen($password);
|
$plen = strlen($password);
|
||||||
|
|
||||||
if ($plen < $pol["minsize"]) {
|
if ($plen < $pol["minsize"] && !($canbeempty && empty($password))) {
|
||||||
$err->raise("admin", _("The password length is too short according to the password policy"));
|
$msg->raise('Error', "admin", _("The password length is too short according to the password policy"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($plen > $pol["maxsize"]) {
|
if ($plen > $pol["maxsize"] && !($canbeempty && empty($password))) {
|
||||||
$err->raise("admin", _("The password is too long according to the password policy"));
|
$msg->raise('Error', "admin", _("The password is too long according to the password policy"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1488,13 +1497,13 @@ EOF;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strpos($password, $l) !== false || strpos($l, $password) !== false) {
|
if (strpos($password, $l) !== false || strpos($l, $password) !== false) {
|
||||||
$err->raise("admin", _("The password policy prevents you to use your login name inside your password or the other way around"));
|
$msg->raise('Error', "admin", _("The password policy prevents you to use your login name inside your password or the other way around"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pol["classcount"] > 0) {
|
if ($pol["classcount"] > 0 && !($canbeempty && empty($password))) {
|
||||||
$cls = array(0, 0, 0, 0, 0);
|
$cls = array(0, 0, 0, 0, 0);
|
||||||
for ($i = 0; $i < strlen($password); $i++) {
|
for ($i = 0; $i < strlen($password); $i++) {
|
||||||
$p = substr($password, $i, 1);
|
$p = substr($password, $i, 1);
|
||||||
|
@ -1512,7 +1521,7 @@ EOF;
|
||||||
} // foreach
|
} // foreach
|
||||||
$clc = array_sum($cls);
|
$clc = array_sum($cls);
|
||||||
if ($clc < $pol["classcount"]) {
|
if ($clc < $pol["classcount"]) {
|
||||||
$err->raise("admin", _("Your password contains not enough different classes of character, between low-case, up-case, figures and special characters."));
|
$msg->raise('Error', "admin", _("Your password contains not enough different classes of character, between low-case, up-case, figures and special characters."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue