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