several changes after code review

This commit is contained in:
Roland Gruber 2003-06-24 15:50:38 +00:00
parent 19ba486459
commit 46fb09b878
7 changed files with 397 additions and 376 deletions

View File

@ -197,7 +197,7 @@ class Config {
fclose($file); fclose($file);
} }
else { else {
StatusMessage("ERROR", "", _("Unable to load lam.conf! ") . $conffile); StatusMessage("ERROR", "", _("Unable to load lam.conf!") . " (" . $conffile . ")");
} }
} }
@ -212,10 +212,12 @@ class Config {
$save_scriptPath = $save_scriptServer = $save_samba3 = $save_domainSID = False; $save_scriptPath = $save_scriptServer = $save_samba3 = $save_domainSID = False;
$file = fopen($conffile, "r"); $file = fopen($conffile, "r");
$file_array = array(); $file_array = array();
// read lam.conf
while (!feof($file)) { while (!feof($file)) {
array_push($file_array, fgets($file, 1024)); array_push($file_array, fgets($file, 1024));
} }
fclose($file); fclose($file);
// generate new lam.conf
for ($i = 0; $i < sizeof($file_array); $i++) { for ($i = 0; $i < sizeof($file_array); $i++) {
if (($file_array[$i] == "\n")||($file_array[$i][0] == "#")) continue; // ignore comments if (($file_array[$i] == "\n")||($file_array[$i][0] == "#")) continue; // ignore comments
// search for keywords // search for keywords
@ -361,11 +363,11 @@ class Config {
fclose($file); fclose($file);
} }
else { else {
StatusMessage("ERROR", "", _("Cannot open config file!")); StatusMessage("ERROR", "", _("Cannot open config file!") . " (" . $conffile . ")");
exit; exit;
} }
} }
} }
// prints current preferences // prints current preferences
function printconf() { function printconf() {
@ -401,7 +403,7 @@ class Config {
// sets the server address // sets the server address
function set_ServerURL($value) { function set_ServerURL($value) {
if (is_string($value)) $this->ServerURL = $value; if (is_string($value)) $this->ServerURL = $value;
else StatusMessage("WARN", "", _("Config->set_ServerURL failed!") . " " . $value . " " . $value); else StatusMessage("WARN", "", _("Config->set_ServerURL failed!") . " (" . $value . ")");
} }
// returns an array of string with all admin names // returns an array of string with all admin names
@ -421,7 +423,7 @@ class Config {
} }
if ($b) $this->Admins = $value; if ($b) $this->Admins = $value;
} }
else StatusMessage("WARN", "", _("Config->set_Admins failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_Admins failed!") . " (" . $value . ")");
} }
// returns all admin users seperated by semicolons // returns all admin users seperated by semicolons
@ -436,7 +438,7 @@ class Config {
$this->Adminstring = $value; $this->Adminstring = $value;
$this->Admins = explode(";", $value); $this->Admins = explode(";", $value);
} }
else StatusMessage("WARN", "", _("Config->set_Adminstring failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_Adminstring failed!") . " (" . $value . ")");
} }
// returns the password to access the preferences wizard // returns the password to access the preferences wizard
@ -447,7 +449,7 @@ class Config {
// sets the preferences wizard password // sets the preferences wizard password
function set_Passwd($value) { function set_Passwd($value) {
if (is_string($value)) $this->Passwd = $value; if (is_string($value)) $this->Passwd = $value;
else StatusMessage("WARN", "", _("Config->set_Passwd failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_Passwd failed!") . " (" . $value . ")");
} }
// returns the LDAP suffix where users are saved // returns the LDAP suffix where users are saved
@ -460,7 +462,7 @@ class Config {
if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) { if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) {
$this->Suff_users = $value; $this->Suff_users = $value;
} }
else StatusMessage("WARN", "", _("Config->set_UserSuffix failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_UserSuffix failed!") . " (" . $value . ")");
} }
// returns the LDAP suffix where groups are saved // returns the LDAP suffix where groups are saved
@ -473,7 +475,7 @@ class Config {
if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) { if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) {
$this->Suff_groups = $value; $this->Suff_groups = $value;
} }
else StatusMessage("WARN", "", _("Config->set_GroupSuffix failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_GroupSuffix failed!") . " (" . $value . ")");
} }
// returns the LDAP suffix where hosts are saved // returns the LDAP suffix where hosts are saved
@ -486,7 +488,7 @@ class Config {
if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) { if (is_string($value) && (eregi("^(([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)(,([a-z]|-|[0-9])*=([a-z]|-|[0-9])*)*$", $value))) {
$this->Suff_hosts = $value; $this->Suff_hosts = $value;
} }
else StatusMessage("WARN", "", _("Config->set_HostSuffix failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_HostSuffix failed!") . " (" . $value . ")");
} }
// returns the minimum UID to use when creating new users // returns the minimum UID to use when creating new users
@ -497,7 +499,7 @@ class Config {
// sets the minimum UID to use when creating new users // sets the minimum UID to use when creating new users
function set_minUID($value) { function set_minUID($value) {
if (is_numeric($value)) $this->MinUID = $value; if (is_numeric($value)) $this->MinUID = $value;
else StatusMessage("WARN", "", _("Config->set_minUID failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_minUID failed!") . " (" . $value . ")");
} }
// returns the maximum UID to use when creating new users // returns the maximum UID to use when creating new users
@ -508,7 +510,7 @@ class Config {
// sets the maximum UID to use when creating new users // sets the maximum UID to use when creating new users
function set_maxUID($value) { function set_maxUID($value) {
if (is_numeric($value)) $this->MaxUID = $value; if (is_numeric($value)) $this->MaxUID = $value;
else StatusMessage("WARN", "", _("Config->set_maxUID failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_maxUID failed!") . " (" . $value . ")");
} }
// returns the minimum GID to use when creating new groups // returns the minimum GID to use when creating new groups
@ -519,7 +521,7 @@ class Config {
// sets the minimum GID to use when creating new groups // sets the minimum GID to use when creating new groups
function set_minGID($value) { function set_minGID($value) {
if (is_numeric($value)) $this->MinGID = $value; if (is_numeric($value)) $this->MinGID = $value;
else StatusMessage("WARN", "", _("Config->set_minGID failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_minGID failed!") . " (" . $value . ")");
} }
// returns the maximum GID to use when creating new groups // returns the maximum GID to use when creating new groups
@ -530,7 +532,7 @@ class Config {
// sets the maximum GID to use when creating new groups // sets the maximum GID to use when creating new groups
function set_maxGID($value) { function set_maxGID($value) {
if (is_numeric($value)) $this->MaxGID = $value; if (is_numeric($value)) $this->MaxGID = $value;
else StatusMessage("WARN", "", _("Config->set_maxGID failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_maxGID failed!") . " (" . $value . ")");
} }
// returns the minimum UID to use when creating new Samba hosts // returns the minimum UID to use when creating new Samba hosts
@ -541,7 +543,7 @@ class Config {
// sets the minimum UID to use when creating new Samba hosts // sets the minimum UID to use when creating new Samba hosts
function set_minMachine($value) { function set_minMachine($value) {
if (is_numeric($value)) $this->MinMachine = $value; if (is_numeric($value)) $this->MinMachine = $value;
else StatusMessage("WARN", "", _("Config->set_minMachine failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_minMachine failed!") . " (" . $value . ")");
} }
// returns the maximum UID to use when creating new Samba hosts // returns the maximum UID to use when creating new Samba hosts
@ -552,7 +554,7 @@ class Config {
// sets the maximum UID to use when creating new Samba hosts // sets the maximum UID to use when creating new Samba hosts
function set_maxMachine($value) { function set_maxMachine($value) {
if (is_numeric($value)) $this->MaxMachine = $value; if (is_numeric($value)) $this->MaxMachine = $value;
else StatusMessage("WARN", "", _("Config->set_maxMachine failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_maxMachine failed!") . " (" . $value . ")");
} }
// returns the list of attributes to show in user list // returns the list of attributes to show in user list
@ -565,7 +567,7 @@ class Config {
if (is_string($value) && eregi("^((#[a-z]*)|([a-z]*:[a-z*]))(;((#[a-z]*)|([a-z]*:[a-z]*)))*$", $value)) { if (is_string($value) && eregi("^((#[a-z]*)|([a-z]*:[a-z*]))(;((#[a-z]*)|([a-z]*:[a-z]*)))*$", $value)) {
$this->userlistAttributes = $value; $this->userlistAttributes = $value;
} }
else StatusMessage("WARN", "", _("Config->set_userlistAttributes failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_userlistAttributes failed!") . " (" . $value . ")");
} }
// returns the list of attributes to show in group list // returns the list of attributes to show in group list
@ -578,7 +580,7 @@ class Config {
if (is_string($value) && eregi("^((#[a-z]*)|([a-z]*:[a-z*]))(;((#[a-z]*)|([a-z]*:[a-z]*)))*$", $value)) { if (is_string($value) && eregi("^((#[a-z]*)|([a-z]*:[a-z*]))(;((#[a-z]*)|([a-z]*:[a-z]*)))*$", $value)) {
$this->grouplistAttributes = $value; $this->grouplistAttributes = $value;
} }
else StatusMessage("WARN", "", _("Config->set_grouplistAttributes failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_grouplistAttributes failed!") . " (" . $value . ")");
} }
// returns the list of attributes to show in host list // returns the list of attributes to show in host list
@ -591,7 +593,7 @@ class Config {
if (is_string($value) && eregi("^((#[a-z]*)|([a-z]*:[a-z*]))(;((#[a-z]*)|([a-z]*:[a-z]*)))*$", $value)) { if (is_string($value) && eregi("^((#[a-z]*)|([a-z]*:[a-z*]))(;((#[a-z]*)|([a-z]*:[a-z]*)))*$", $value)) {
$this->hostlistAttributes = $value; $this->hostlistAttributes = $value;
} }
else StatusMessage("WARN", "", _("Config->set_hostlistAttributes failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_hostlistAttributes failed!") . " (" . $value . ")");
} }
// returns the maximum number of rows in user/group/host lists // returns the maximum number of rows in user/group/host lists
@ -613,7 +615,7 @@ class Config {
// sets the default language string // sets the default language string
function set_defaultLanguage($value) { function set_defaultLanguage($value) {
if (is_string($value)) $this->defaultLanguage = $value; if (is_string($value)) $this->defaultLanguage = $value;
else StatusMessage("WARN", "", _("Config->set_defaultLanguage failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_defaultLanguage failed!") . " (" . $value . ")");
} }
// returns the path to the external script // returns the path to the external script
@ -625,7 +627,7 @@ class Config {
function set_scriptPath($value) { function set_scriptPath($value) {
if (!$value) $value = ""; // optional parameter if (!$value) $value = ""; // optional parameter
if (is_string($value) && eregi("^()|(/([a-z]|[0-9]|-|_|/)*)$", $value)) $this->scriptPath = $value; if (is_string($value) && eregi("^()|(/([a-z]|[0-9]|-|_|/)*)$", $value)) $this->scriptPath = $value;
else StatusMessage("WARN", "", _("Config->set_scriptPath failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_scriptPath failed!") . " (" . $value . ")");
} }
// returns the server of the external script // returns the server of the external script
@ -639,7 +641,7 @@ class Config {
if (is_string($value) && (eregi("^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$", $value) || $value == "")) { if (is_string($value) && (eregi("^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$", $value) || $value == "")) {
$this->scriptServer = $value; $this->scriptServer = $value;
} }
else StatusMessage("WARN", "", _("Config->set_scriptServer failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_scriptServer failed!") . " (" . $value . ")");
} }
// returns "yes" if Samba 3.x schema is used, otherwise "no" // returns "yes" if Samba 3.x schema is used, otherwise "no"
@ -652,7 +654,7 @@ class Config {
if (is_string($value) && eregi("^(yes|no)$", $value)) { if (is_string($value) && eregi("^(yes|no)$", $value)) {
$this->samba3 = $value; $this->samba3 = $value;
} }
else StatusMessage("WARN", "", _("Config->set_samba3 failed!") . " " . $value); else StatusMessage("WARN", "", _("Config->set_samba3 failed!") . " (" . $value . ")");
} }
// returns the Samba domain SID (Samba 3 only) // returns the Samba domain SID (Samba 3 only)
@ -662,11 +664,14 @@ class Config {
// sets the Samba domain SID (Samba 3 only) // sets the Samba domain SID (Samba 3 only)
function set_domainSID($value) { function set_domainSID($value) {
if (!$value) $value = ""; // optional parameter if (!$value) { // optional parameter
if (is_string($value) && eregi("^(S-[0-9]-[0-9]-[0-9]{2,2}-[0-9]{10,10}-[0-9]{10,10}-[0-9]{10,10})|()$", $value)) { $value = "";
$this->domainSID = $value; $this->domainSID = $value;
} }
else StatusMessage("WARN", "", _("Config->set_domainSID failed!") . " " . $value); elseif (is_string($value) && eregi("^S-[0-9]-[0-9]-[0-9]{2,2}-[0-9]{10,10}-[0-9]{10,10}-[0-9]{10,10}$", $value)) {
$this->domainSID = $value;
}
else StatusMessage("WARN", "", _("Config->set_domainSID failed!") . " (" . $value . ")");
} }

View File

@ -84,7 +84,8 @@ function loadUserProfile($profile) {
$acc = new account(); $acc = new account();
$file = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/users/" . $profile . ".pru"; $file = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/users/" . $profile . ".pru";
if (is_file($file) == True) { if (is_file($file) == True) {
$file = fopen($file, "r"); $file = @fopen($file, "r");
if ($file) {
while (!feof($file)) { while (!feof($file)) {
$line = fgets($file, 1024); $line = fgets($file, 1024);
if (($line == "\n")||($line[0] == "#")) continue; // ignore comments if (($line == "\n")||($line[0] == "#")) continue; // ignore comments
@ -185,7 +186,11 @@ function loadUserProfile($profile) {
fclose($file); fclose($file);
} }
else { else {
echo _("Unable to load profile! ") . $file ; echo "<br>"; StatusMessage("ERROR", "", _("Unable to load profile! ") . $file);
}
}
else {
StatusMessage("ERROR", "", _("Unable to load profile! ") . $file);
} }
return $acc; return $acc;
} }
@ -203,7 +208,8 @@ function loadHostProfile($profile) {
$acc = new account(); $acc = new account();
$file = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/hosts/" . $profile . ".prh"; $file = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/hosts/" . $profile . ".prh";
if (is_file($file) == True) { if (is_file($file) == True) {
$file = fopen($file, "r"); $file = @fopen($file, "r");
if ($file) {
while (!feof($file)) { while (!feof($file)) {
$line = fgets($file, 1024); $line = fgets($file, 1024);
if (($line == "\n")||($line[0] == "#")) continue; // ignore comments if (($line == "\n")||($line[0] == "#")) continue; // ignore comments
@ -276,7 +282,11 @@ function loadHostProfile($profile) {
fclose($file); fclose($file);
} }
else { else {
echo _("Unable to load profile! ") . $file ; echo "<br>"; StatusMessage("ERROR", "", _("Unable to load profile! ") . $file);
}
}
else {
StatusMessage("ERROR", "", _("Unable to load profile! ") . $file);
} }
return $acc; return $acc;
} }
@ -285,7 +295,10 @@ function loadHostProfile($profile) {
// file is created, if needed // file is created, if needed
function saveUserProfile($account, $profile) { function saveUserProfile($account, $profile) {
if (!eregi("^([0-9]|[a-z]|-|_)*$", $profile)) exit; if (!eregi("^([0-9]|[a-z]|-|_)*$", $profile)) exit;
if (!is_object($account)) {echo _("saveUserProfile: \$account has wrong type!"); exit;} if (!is_object($account)) {
StatusMessage("ERROR", "", _("saveUserProfile: \$account has wrong type!"));
exit;
}
$path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/users/" . $profile . ".pru"; $path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/users/" . $profile . ".pru";
$file = fopen($path, "w"); $file = fopen($path, "w");
// replace user and group names // replace user and group names
@ -343,7 +356,10 @@ function saveGroupProfile($account, $profile) {
// file is created, if needed // file is created, if needed
function saveHostProfile($account, $profile) { function saveHostProfile($account, $profile) {
if (!eregi("^[0-9a-z\\-_]+$", $profile)) exit; if (!eregi("^[0-9a-z\\-_]+$", $profile)) exit;
if (!is_object($account)) {echo _("saveHostProfile: \$account has wrong type!"); exit;} if (!is_object($account)) {
StatusMessage ("ERROR", "", _("saveHostProfile: \$account has wrong type!"));
exit;
}
$path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/hosts/" . $profile . ".prh"; $path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/hosts/" . $profile . ".prh";
$file = fopen($path, "w"); $file = fopen($path, "w");
// write attributes // write attributes

View File

@ -25,7 +25,7 @@ $Id$
// start session // start session
session_save_path("../../sess"); session_save_path("../../sess");
session_start(); @session_start();
echo ("<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>"); echo ("<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>");
echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"); echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
@ -35,30 +35,30 @@ echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http:/
<html> <html>
<head> <head>
<title> <title>
<? <?php
echo _("Login"); echo _("Login");
?> ?>
</title> </title>
<link rel="stylesheet" type="text/css" href="../../style/layout.css"> <link rel="stylesheet" type="text/css" href="../../style/layout.css">
</head> </head>
<body> <body>
<p align="center"><a href="http://lam.sf.net" target="new_window"> <p align="center"><a href="http://lam.sf.net" target="_blank">
<img src="../../graphics/banner.jpg" border=1 alt="LDAP Account Manager"></a> <img src="../../graphics/banner.jpg" border=1 alt="LDAP Account Manager"></a>
</p> </p>
<hr><br><br> <hr><br><br>
<form action="confmain.php" method="post"> <form action="confmain.php" method="post">
<table border=0 align="center"> <table border=0 align="center">
<tr> <tr>
<td colspan=3 align="center"><b> <? echo _("Password to enter preferences:"); ?> </b></td> <td colspan=3 align="center"><b> <?php echo _("Password to enter preferences:"); ?> </b></td>
</tr> </tr>
<? <?php
// print message if login was incorrect // print message if login was incorrect
if ($message) echo ("<tr><td colspan=3 align=\"center\"><font color=red>" . $message . "</font></td></tr>"); if ($message) echo ("<tr><td colspan=3 align=\"center\"><font color=red>" . $message . "</font></td></tr>");
?> ?>
<tr> <tr>
<td align="center"><input type="password" name="passwd"></td> <td align="center"><input type="password" name="passwd"></td>
<td><input type="submit" name="submit" value= <? echo _("Ok"); ?> </td> <td><input type="submit" name="submit" value= <?php echo _("Ok"); ?> </td>
<td><a href="../help.php?HelpNumber=200" target="lamhelp"><? echo _("Help") ?></a></td> <td><a href="../help.php?HelpNumber=200" target="lamhelp"><?php echo _("Help") ?></a></td>
</tr> </tr>
</table> </table>
</form> </form>

View File

@ -28,7 +28,7 @@ include_once ("../../lib/config.inc");
// start session // start session
session_save_path("../../sess"); session_save_path("../../sess");
session_start(); @session_start();
// check if button was pressed and if we have to save the setting or go back to login // check if button was pressed and if we have to save the setting or go back to login
if ($_POST['back'] || $_POST['submitconf']){ if ($_POST['back'] || $_POST['submitconf']){
@ -102,7 +102,7 @@ echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http:/
echo ("<html>\n"); echo ("<html>\n");
echo ("<head>\n"); echo ("<head>\n");
echo ("<title>" . _("LDAP Account Manager Configuration") . "</title>\n"); echo ("<title>" . _("LDAP Account Manager Configuration") . "</title>\n");
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n"; echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n");
echo ("</head>\n"); echo ("</head>\n");
echo ("<body>\n"); echo ("<body>\n");
echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\">". echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\">".
@ -296,7 +296,7 @@ echo ("</table>\n");
echo ("</fieldset>\n"); echo ("</fieldset>\n");
echo ("<p></p>\n"); echo ("<p></p>\n");
// security setings
echo ("<fieldset><legend><b>" . _("Security settings") . "</b></legend>\n"); echo ("<fieldset><legend><b>" . _("Security settings") . "</b></legend>\n");
echo ("<table border=0>\n"); echo ("<table border=0>\n");
// admin list // admin list

View File

@ -31,7 +31,7 @@ session_start();
include_once ('../../lib/config.inc'); include_once ('../../lib/config.inc');
$conf = new Config(); $conf = new Config();
// get data if register_globals is off // get data from session
if ($_SESSION['passwd']) $passwd = $_SESSION['passwd']; if ($_SESSION['passwd']) $passwd = $_SESSION['passwd'];
if ($_SESSION['passwd1']) $passwd1 = $_SESSION['passwd1']; if ($_SESSION['passwd1']) $passwd1 = $_SESSION['passwd1'];
if ($_SESSION['passwd2']) $passwd2 = $_SESSION['passwd2']; if ($_SESSION['passwd2']) $passwd2 = $_SESSION['passwd2'];
@ -74,95 +74,95 @@ echo ("<p align=\"center\"><a href=\"http://lam.sf.net\" target=\"new_window\">"
"<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a></p><hr><br><br>"); "<img src=\"../../graphics/banner.jpg\" border=1 alt=\"LDAP Account Manager\"></a></p><hr><br><br>");
// check new preferences // check new preferences
if (chop($serverurl) == "") { if (!$serverurl) {
echo _("<font color=\"red\"><b>" . _("Server Address is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("Server Address is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($admins) == "") { if (!$admins) {
echo _("<font color=\"red\"><b>" . _("List of admin users is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("List of admin users is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($suffusers) == "") { if (!$suffusers) {
echo _("<font color=\"red\"><b>" . _("UserSuffix is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("UserSuffix is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($suffgroups) == "") { if (!$suffgroups) {
echo _("<font color=\"red\"><b>" . _("UserSuffix is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("UserSuffix is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($suffhosts) == "") { if (!$suffhosts) {
echo _("<font color=\"red\"><b>" . _("HostSuffix is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("HostSuffix is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($minUID) == "") { if (!$minUID) {
echo _("<font color=\"red\"><b>" . _("MinUID is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("MinUID is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($maxUID) == "") { if (!$maxUID) {
echo _("<font color=\"red\"><b>" . _("MaxUID is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("MaxUID is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($minGID) == "") { if (!$minGID) {
echo _("<font color=\"red\"><b>" . _("MinGID is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("MinGID is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($maxGID) == "") { if (!$maxGID) {
echo _("<font color=\"red\"><b>" . _("MaxGID is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("MaxGID is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($minMach) == "") { if (!$minMach) {
echo _("<font color=\"red\"><b>" . _("MinMachine is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("MinMachine is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($maxMach) == "") { if (!$maxMach) {
echo _("<font color=\"red\"><b>" . _("MaxMachine is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("MaxMachine is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($usrlstattr) == "") { if (!$usrlstattr) {
echo _("<font color=\"red\"><b>" . _("No attributes in user list!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("No attributes in user list!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($grplstattr) == "") { if (!$grplstattr) {
echo _("<font color=\"red\"><b>" . _("No attributes in group list!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("No attributes in group list!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($hstlstattr) == "") { if (!$hstlstattr) {
echo _("<font color=\"red\"><b>" . _("No attributes in host list!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("No attributes in host list!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($maxlistentries) == "") { if (!$maxlistentries) {
echo _("<font color=\"red\"><b>" . _("Max list entries is empty!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("Max list entries is empty!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($language) == "") { if (!$language) {
echo _("<font color=\"red\"><b>" . _("Language is not defined!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("Language is not defined!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if (chop($samba3) == "") { if (!$samba3) {
echo _("<font color=\"red\"><b>" . _("Samba version is not defined!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("Samba version is not defined!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;
} }
if ((chop($samba3) == "yes") && (($domainSID == "") || (!$domainSID))) { if (($samba3 == "yes") && (!$domainSID)) {
echo _("<font color=\"red\"><b>" . _("Samba 3 needs a domain SID!") . "</b></font>"); echo _("<font color=\"red\"><b>" . _("Samba 3 needs a domain SID!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit; exit;

View File

@ -50,7 +50,7 @@ echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http:/
<html> <html>
<head> <head>
<title> <title>
<? echo _("Logout"); ?> <?php echo _("Logout"); ?>
</title> </title>
<link rel="stylesheet" type="text/css" href="../style/layout.css"> <link rel="stylesheet" type="text/css" href="../style/layout.css">
</head> </head>
@ -60,7 +60,7 @@ echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http:/
</p> </p>
<hr> <hr>
<br> <br>
<p align="center"><big><? echo ("You have been logged off from LDAP Account Manager."); ?></big></p> <p align="center"><big><?php echo ("You have been logged off from LDAP Account Manager."); ?></big></p>
<br><br><br><br><br><a href="../templates/login.php" target="_top"> <? echo _("Back to Login") ?> </a> <br><br><br><br><br><a href="../templates/login.php" target="_top"> <?php echo _("Back to Login") ?> </a>
</body> </body>
</html> </html>

View File

@ -38,25 +38,25 @@ echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http:/
<body> <body>
<table border=0 width="100%"> <table border=0 width="100%">
<tr> <tr>
<td width="100" align="left"><a href="./profedit/profilemain.php" target="mainpart"><? echo _("Profile Editor") ?></a></td> <td width="100" align="left"><a href="./profedit/profilemain.php" target="mainpart"><?php echo _("Profile Editor") ?></a></td>
<td rowspan=3 colspan=3 align="center"> <td rowspan=3 colspan=3 align="center">
<a href="http://lam.sf.net" target="new_window"><img src="../graphics/banner.jpg" border=1 alt="LDAP Account Manager"></a> <a href="http://lam.sf.net" target="new_window"><img src="../graphics/banner.jpg" border=1 alt="LDAP Account Manager"></a>
</td> </td>
<td width="100" align="right" height=20><a href="./logout.php" target="_top"><big><b><? echo _("Logout") ?></b></big></a></td> <td width="100" align="right" height=20><a href="./logout.php" target="_top"><big><b><?php echo _("Logout") ?></b></big></a></td>
</tr> </tr>
<tr> <tr>
<td align="left"><a href="ou_edit.php" target="mainpart"><? echo _("OU Editor") ?></a></td> <td align="left"><a href="ou_edit.php" target="mainpart"><?php echo _("OU Editor") ?></a></td>
<td rowspan=2></td> <td rowspan=2></td>
</tr> </tr>
<tr> <tr>
<td align="left"><a href="masscreate.php" target="mainpart"><? echo _("File Upload") ?></a></td> <td align="left"><a href="masscreate.php" target="mainpart"><?php echo _("File Upload") ?></a></td>
</tr> </tr>
<tr><td colspan=5>&nbsp;</td></tr> <tr><td colspan=5>&nbsp;</td></tr>
<tr> <tr>
<td></td> <td></td>
<td width="200" align="center"><a href="./lists/listusers.php" target="mainpart"> <? echo _("Users");?> </a></td> <td width="200" align="center"><a href="./lists/listusers.php" target="mainpart"> <?php echo _("Users");?> </a></td>
<td width="200" align="center"><a href="./lists/listgroups.php" target="mainpart"> <? echo _("Groups");?> </a></td> <td width="200" align="center"><a href="./lists/listgroups.php" target="mainpart"> <?php echo _("Groups");?> </a></td>
<td width="200" align="center"><a href="./lists/listhosts.php" target="mainpart"> <? echo _("Hosts");?> </a></td> <td width="200" align="center"><a href="./lists/listhosts.php" target="mainpart"> <?php echo _("Hosts");?> </a></td>
<td></td> <td></td>
</tr> </tr>
</table> </table>