added metaRefresh function
This commit is contained in:
parent
0d91469a18
commit
f53e55d32e
|
@ -56,6 +56,24 @@ function getConfigProfiles() {
|
|||
return $ret;
|
||||
}
|
||||
|
||||
// print meta refresh
|
||||
// $page is the target page
|
||||
function metaRefresh($page) {
|
||||
echo $_SESSION['header'];
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<title></title>\n";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"0; URL=" . $page . "\">\n";
|
||||
echo "</head>\n";
|
||||
echo "<body>\n";
|
||||
// print link if refresh does not work
|
||||
echo "<p>\n";
|
||||
echo "<a href=\"" . $page . "\">" . _("Click here if you are not directed to the next page.") . "</a>\n";
|
||||
echo "</p>\n";
|
||||
echo "</body>\n";
|
||||
echo "</html>\n";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// class Config
|
||||
|
|
|
@ -65,11 +65,11 @@ if ($_POST['back'] || $_POST['submitconf']){
|
|||
if ($_POST['scriptserver']) $_SESSION['scriptserver'] = $_POST['scriptserver'];
|
||||
else $_SESSION['scriptserver'] = "";
|
||||
if ($_POST['filename']) $_SESSION['filename'] = $_POST['filename'];
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=confsave.php\">");
|
||||
metaRefresh("confsave.php");
|
||||
}
|
||||
// back to login
|
||||
else if ($_POST['back']){
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../login.php\">");
|
||||
metaRefresh("../login.php");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ elseif ($_POST['sub_save']) {
|
|||
|
||||
// back to list
|
||||
elseif ($_POST['sub_back']) {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=lists/listdomains.php\">");
|
||||
metaRefresh("lists/listdomains.php");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ $dom_units = $_SESSION['dom_units'];
|
|||
if ($_POST['new_domain'] || $_POST['del_domain']){
|
||||
// add new domain
|
||||
if ($_POST['new_domain']){
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../domain.php?action=new\">");
|
||||
metaRefresh("../domain.php?action=new");
|
||||
exit;
|
||||
}
|
||||
// delete domain(s)
|
||||
|
@ -53,7 +53,7 @@ if ($_POST['new_domain'] || $_POST['del_domain']){
|
|||
// search for checkboxes
|
||||
$domains = array_keys($_POST, "on");
|
||||
$domainstr = implode(";", $domains);
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../domain.php?action=delete&DN='$domainstr'\">");
|
||||
metaRefresh("../domain.php?action=delete&DN='$domainstr'");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ $grp_units = $_SESSION['grp_units'];
|
|||
if ($_POST['new_group'] || $_POST['del_group']){
|
||||
// add new group
|
||||
if ($_POST['new_group']){
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../account.php?type=group\">");
|
||||
metaRefresh("../account.php?type=group");
|
||||
exit;
|
||||
}
|
||||
// delete group(s)
|
||||
|
@ -53,7 +53,7 @@ if ($_POST['new_group'] || $_POST['del_group']){
|
|||
// search for checkboxes
|
||||
$groups = array_keys($_POST, "on");
|
||||
$groupstr = implode(";", $groups);
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../delete.php?type=group&DN='$groupstr'\">");
|
||||
metaRefresh("../delete.php?type=group&DN='$groupstr'");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ $hst_units = $_SESSION['hst_units'];
|
|||
if ($_POST['new_host'] || $_POST['del_host']){
|
||||
// add new host
|
||||
if ($_POST['new_host']){
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../account.php?type=host\">");
|
||||
metaRefresh("../account.php?type=host");
|
||||
exit;
|
||||
}
|
||||
// delete host(s)
|
||||
|
@ -53,7 +53,7 @@ if ($_POST['new_host'] || $_POST['del_host']){
|
|||
// search for checkboxes
|
||||
$hosts = array_keys($_POST, "on");
|
||||
$hoststr = implode(";", $hosts);
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../delete.php?type=host&DN='$hoststr'\">");
|
||||
metaRefresh("../delete.php?type=host&DN='$hoststr'");
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ $usr_units = $_SESSION['usr_units'];
|
|||
if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user']){
|
||||
// add new user
|
||||
if ($_POST['new_user']){
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../account.php?type=user\">");
|
||||
metaRefresh("../account.php?type=user");
|
||||
exit;
|
||||
}
|
||||
// delete user(s)
|
||||
|
@ -74,7 +74,7 @@ if ($_POST['new_user'] || $_POST['del_user'] || $_POST['pdf_user']){
|
|||
// search for checkboxes
|
||||
$users = array_keys($_POST, "on");
|
||||
$userstr = implode(";", $users);
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../delete.php?type=user&DN='$userstr'\">");
|
||||
metaRefresh("../delete.php?type=user&DN='$userstr'");
|
||||
}
|
||||
// PDF
|
||||
elseif ($_POST['pdf_user']){
|
||||
|
|
|
@ -41,7 +41,7 @@ $dn = $_SESSION['ldap']->search_username($user);
|
|||
|
||||
if ($dn) {
|
||||
// redirect to account.php
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../account.php?type=user&DN='$dn'\">");
|
||||
metaRefresh("../account.php?type=user&DN='$dn'");
|
||||
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -38,13 +38,13 @@ setlanguage();
|
|||
// abort button was pressed in profileuser/~host.php
|
||||
// back to profile editor
|
||||
if ($_POST['abort']) {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=profilemain.php\">");
|
||||
metaRefresh("profilemain.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// check if user is logged in, if not go to login
|
||||
if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../login.php\">\n");
|
||||
metaRefresh("../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ setlanguage();
|
|||
|
||||
// check if user is logged in, if not go to login
|
||||
if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../login.php\">\n");
|
||||
metaRefresh("../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ setlanguage();
|
|||
|
||||
// check if user is logged in, if not go to login
|
||||
if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../login.php\">\n");
|
||||
metaRefresh("../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ setlanguage();
|
|||
|
||||
// check if user is logged in, if not go to login
|
||||
if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../login.php\">");
|
||||
metaRefresh("../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -43,33 +43,33 @@ if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
|
|||
if ($_POST['forward'] == "yes") {
|
||||
// on abort go back to main page
|
||||
if ($_POST['abort']) {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../lists/listusers.php\">");
|
||||
metaRefresh("../lists/listusers.php");
|
||||
}
|
||||
// on submit forward to other profile pages
|
||||
elseif ($_POST['submit']) {
|
||||
// create new user profile
|
||||
if ($_POST['profile'] == "newuser") {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=profileuser.php\">");
|
||||
metaRefresh("profileuser.php");
|
||||
}
|
||||
// edit user profile
|
||||
elseif($_POST['profile'] == "edituser") {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=profileuser.php?edit=" . $_POST['e_user'] . "\">");
|
||||
metaRefresh("profileuser.php?edit=" . $_POST['e_user']);
|
||||
}
|
||||
// delete user profile
|
||||
elseif($_POST['profile'] == "deluser") {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=profiledelete.php?type=user&del=" . $_POST['d_user'] . "\">");
|
||||
metaRefresh("profiledelete.php?type=user&del=" . $_POST['d_user']);
|
||||
}
|
||||
// create new host profile
|
||||
elseif ($_POST['profile'] == "newhost") {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=profilehost.php\">");
|
||||
metaRefresh("profilehost.php");
|
||||
}
|
||||
// edit host profile
|
||||
elseif($_POST['profile'] == "edithost") {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=profilehost.php?edit=" . $_POST['e_host'] . "\">");
|
||||
metaRefresh("profilehost.php?edit=" . $_POST['e_host']);
|
||||
}
|
||||
// delete user profile
|
||||
elseif($_POST['profile'] == "delhost") {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=profiledelete.php?type=host&del=" . $_POST['d_host'] . "\">");
|
||||
metaRefresh("profiledelete.php?type=host&del=" . $_POST['d_host']);
|
||||
}
|
||||
}
|
||||
exit;
|
||||
|
|
|
@ -36,7 +36,7 @@ setlanguage();
|
|||
|
||||
// check if user is logged in, if not go to login
|
||||
if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
|
||||
echo("<meta http-equiv=\"refresh\" content=\"0; URL=../login.php\">\n");
|
||||
metaRefresh("../login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue