translation update
This commit is contained in:
parent
f6edf82814
commit
63bf69b609
|
@ -233,47 +233,54 @@ function saveUserProfile($account, $profile) {
|
|||
exit;
|
||||
}
|
||||
$path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/users/" . $profile . ".pru";
|
||||
$file = fopen($path, "w");
|
||||
// replace user and group names
|
||||
$homedir = $account->general_homedir;
|
||||
$profpath = $account->smb_profilePath;
|
||||
$scriptPath = $account->smb_scriptPath;
|
||||
$smbhome = $account->smb_smbhome;
|
||||
if ($account->general_username) {
|
||||
$homedir = str_replace($account->general_username, "\$user", $homedir);
|
||||
$profpath = str_replace($account->general_username, "\$user", $profpath);
|
||||
$scriptPath = str_replace($account->general_username, "\$user", $scriptPath);
|
||||
$smbhome = str_replace($account->general_username, "\$user", $smbhome);
|
||||
$file = @fopen($path, "w");
|
||||
if ($file) {
|
||||
// replace user and group names
|
||||
$homedir = $account->general_homedir;
|
||||
$profpath = $account->smb_profilePath;
|
||||
$scriptPath = $account->smb_scriptPath;
|
||||
$smbhome = $account->smb_smbhome;
|
||||
if ($account->general_username) {
|
||||
$homedir = str_replace($account->general_username, "\$user", $homedir);
|
||||
$profpath = str_replace($account->general_username, "\$user", $profpath);
|
||||
$scriptPath = str_replace($account->general_username, "\$user", $scriptPath);
|
||||
$smbhome = str_replace($account->general_username, "\$user", $smbhome);
|
||||
}
|
||||
if ($account->general_group) {
|
||||
$homedir = str_replace($account->general_group, "\$group", $homedir);
|
||||
$profpath = str_replace($account->general_group, "\$group", $profpath);
|
||||
$scriptPath = str_replace($account->general_group, "\$group", $scriptPath);
|
||||
$smbhome = str_replace($account->general_group, "\$group", $smbhome);
|
||||
}
|
||||
// write attributes
|
||||
if (isset($account->general_group)) fputs($file, "general_group: " . $account->general_group . "\n");
|
||||
if (isset($account->general_groupadd)) fputs($file, "general_groupadd: " . implode(";", $account->general_groupadd) . "\n");
|
||||
if (isset($account->general_homedir)) fputs($file, "general_homedir: " . $homedir . "\n");
|
||||
if (isset($account->general_shell)) fputs($file, "general_shell: " . $account->general_shell . "\n");
|
||||
if (isset($account->unix_password_no)) fputs($file, "unix_password_no: " . $account->unix_password_no . "\n");
|
||||
if (isset($account->unix_pwdwarn)) fputs($file, "unix_pwdwarn: " . $account->unix_pwdwarn . "\n");
|
||||
if (isset($account->unix_pwdallowlogin)) fputs($file, "unix_pwdallowlogin: " . $account->unix_pwdallowlogin . "\n");
|
||||
if (isset($account->unix_pwdminage)) fputs($file, "unix_pwdminage: " . $account->unix_pwdminage . "\n");
|
||||
if (isset($account->unix_pwdmaxage)) fputs($file, "unix_pwdmaxage: " . $account->unix_pwdmaxage . "\n");
|
||||
if (isset($account->unix_pwdexpire)) fputs($file, "unix_pwdexpire: " . $account->unix_pwdexpire . "\n");
|
||||
if (isset($account->unix_deactivated)) fputs($file, "unix_deactivated: " . $account->unix_deactivated . "\n");
|
||||
if (isset($account->smb_password_no)) fputs($file, "smb_password_no: " . $account->smb_password_no . "\n");
|
||||
if (isset($account->smb_useunixpwd)) fputs($file, "smb_useunixpwd: " . $account->smb_useunixpwd . "\n");
|
||||
if (isset($account->smb_flagsD)) fputs($file, "smb_flagsD: " . $account->smb_flagsD . "\n");
|
||||
if (isset($account->smb_homedrive)) fputs($file, "smb_homedrive: " . $account->smb_homedrive . "\n");
|
||||
if (isset($account->smb_scriptPath)) fputs($file, "smb_scriptPath: " . $scriptPath . "\n");
|
||||
if (isset($account->smb_profilePath)) fputs($file, "smb_profilePath: " . $profpath . "\n");
|
||||
if (isset($account->smb_smbuserworkstations)) fputs($file, "smb_smbuserworkstations: " . $account->smb_smbuserworkstations . "\n");
|
||||
if (isset($account->smb_smbhome)) fputs($file, "smb_smbhome: " . $smbhome . "\n");
|
||||
if (isset($account->smb_domain)) fputs($file, "smb_domain: " . $account->smb_domain . "\n");
|
||||
// close file
|
||||
fclose($file);
|
||||
}
|
||||
if ($account->general_group) {
|
||||
$homedir = str_replace($account->general_group, "\$group", $homedir);
|
||||
$profpath = str_replace($account->general_group, "\$group", $profpath);
|
||||
$scriptPath = str_replace($account->general_group, "\$group", $scriptPath);
|
||||
$smbhome = str_replace($account->general_group, "\$group", $smbhome);
|
||||
else {
|
||||
StatusMessage("ERROR", _("Unable to save profile!"), $path);
|
||||
return false;
|
||||
}
|
||||
// write attributes
|
||||
if (isset($account->general_group)) fputs($file, "general_group: " . $account->general_group . "\n");
|
||||
if (isset($account->general_groupadd)) fputs($file, "general_groupadd: " . implode(";", $account->general_groupadd) . "\n");
|
||||
if (isset($account->general_homedir)) fputs($file, "general_homedir: " . $homedir . "\n");
|
||||
if (isset($account->general_shell)) fputs($file, "general_shell: " . $account->general_shell . "\n");
|
||||
if (isset($account->unix_password_no)) fputs($file, "unix_password_no: " . $account->unix_password_no . "\n");
|
||||
if (isset($account->unix_pwdwarn)) fputs($file, "unix_pwdwarn: " . $account->unix_pwdwarn . "\n");
|
||||
if (isset($account->unix_pwdallowlogin)) fputs($file, "unix_pwdallowlogin: " . $account->unix_pwdallowlogin . "\n");
|
||||
if (isset($account->unix_pwdminage)) fputs($file, "unix_pwdminage: " . $account->unix_pwdminage . "\n");
|
||||
if (isset($account->unix_pwdmaxage)) fputs($file, "unix_pwdmaxage: " . $account->unix_pwdmaxage . "\n");
|
||||
if (isset($account->unix_pwdexpire)) fputs($file, "unix_pwdexpire: " . $account->unix_pwdexpire . "\n");
|
||||
if (isset($account->unix_deactivated)) fputs($file, "unix_deactivated: " . $account->unix_deactivated . "\n");
|
||||
if (isset($account->smb_password_no)) fputs($file, "smb_password_no: " . $account->smb_password_no . "\n");
|
||||
if (isset($account->smb_useunixpwd)) fputs($file, "smb_useunixpwd: " . $account->smb_useunixpwd . "\n");
|
||||
if (isset($account->smb_flagsD)) fputs($file, "smb_flagsD: " . $account->smb_flagsD . "\n");
|
||||
if (isset($account->smb_homedrive)) fputs($file, "smb_homedrive: " . $account->smb_homedrive . "\n");
|
||||
if (isset($account->smb_scriptPath)) fputs($file, "smb_scriptPath: " . $scriptPath . "\n");
|
||||
if (isset($account->smb_profilePath)) fputs($file, "smb_profilePath: " . $profpath . "\n");
|
||||
if (isset($account->smb_smbuserworkstations)) fputs($file, "smb_smbuserworkstations: " . $account->smb_smbuserworkstations . "\n");
|
||||
if (isset($account->smb_smbhome)) fputs($file, "smb_smbhome: " . $smbhome . "\n");
|
||||
if (isset($account->smb_domain)) fputs($file, "smb_domain: " . $account->smb_domain . "\n");
|
||||
// close file
|
||||
fclose($file);
|
||||
return true;
|
||||
}
|
||||
|
||||
// saves an account object to an group profile with name $profile (without .prg)
|
||||
|
@ -291,12 +298,19 @@ function saveHostProfile($account, $profile) {
|
|||
exit;
|
||||
}
|
||||
$path = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/hosts/" . $profile . ".prh";
|
||||
$file = fopen($path, "w");
|
||||
// write attributes
|
||||
if (isset($account->general_group)) fputs($file, "general_group: " . $account->general_group . "\n");
|
||||
if (isset($account->smb_domain)) fputs($file, "smb_domain: " . $account->smb_domain . "\n");
|
||||
// close file
|
||||
fclose($file);
|
||||
$file = @fopen($path, "w");
|
||||
if ($file) {
|
||||
// write attributes
|
||||
if (isset($account->general_group)) fputs($file, "general_group: " . $account->general_group . "\n");
|
||||
if (isset($account->smb_domain)) fputs($file, "smb_domain: " . $account->smb_domain . "\n");
|
||||
// close file
|
||||
fclose($file);
|
||||
}
|
||||
else {
|
||||
StatusMessage("ERROR", _("Unable to save profile!"), $path);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// deletes a user profile
|
||||
|
|
|
@ -170,12 +170,12 @@ echo "</tr>\n";
|
|||
|
||||
// print filter row
|
||||
echo "<tr align=\"center\" class=\"grouplist\"><td width=22 height=34></td><td>";
|
||||
echo "<input type=\"submit\" name=\"apply_filter\" value=\"" . _("Apply") . "\">";
|
||||
echo "<input type=\"submit\" name=\"apply_filter\" value=\"" . _("Filter") . "\">";
|
||||
echo "</td>";
|
||||
// print input boxes for filters
|
||||
for ($k = 0; $k < sizeof ($desc_array); $k++) {
|
||||
echo "<td>";
|
||||
echo ("<input type=\"text\" name=\"filter" . strtolower ($attr_array[$k]) .
|
||||
echo ("<input type=\"text\" size=15 name=\"filter" . strtolower ($attr_array[$k]) .
|
||||
"\" value=\"" . $_POST["filter" . strtolower($attr_array[$k])] . "\">");
|
||||
echo "</td>";
|
||||
}
|
||||
|
|
|
@ -176,12 +176,12 @@ echo "</tr>\n";
|
|||
|
||||
// print filter row
|
||||
echo "<tr align=\"center\" class=\"hostlist\"><td width=22 height=34></td><td>";
|
||||
echo "<input type=\"submit\" name=\"apply_filter\" value=\"" . _("Apply") . "\">";
|
||||
echo "<input type=\"submit\" name=\"apply_filter\" value=\"" . _("Filter") . "\">";
|
||||
echo "</td>";
|
||||
// print input boxes for filters
|
||||
for ($k = 0; $k < sizeof ($desc_array); $k++) {
|
||||
echo "<td>";
|
||||
echo ("<input type=\"text\" name=\"filter" . strtolower ($attr_array[$k]) .
|
||||
echo ("<input type=\"text\" size=15 name=\"filter" . strtolower ($attr_array[$k]) .
|
||||
"\" value=\"" . $_POST["filter" . strtolower($attr_array[$k])] . "\">");
|
||||
echo "</td>";
|
||||
}
|
||||
|
|
|
@ -192,13 +192,13 @@ if ($user_count != 0) {
|
|||
echo "</tr>\n";
|
||||
|
||||
echo "<tr class=\"userlist\"><th width=22 height=34></th><th>\n";
|
||||
echo "<input type=\"submit\" name=\"apply_filter\" value=\"" . _("Apply") . "\">";
|
||||
echo "<input type=\"submit\" name=\"apply_filter\" value=\"" . _("Filter") . "\">";
|
||||
echo "</th>\n";
|
||||
|
||||
// print input boxes for filters
|
||||
for ($k = 0; $k < sizeof ($desc_array); $k++) {
|
||||
echo "<th>";
|
||||
echo ("<input type=\"text\" name=\"filter" . strtolower ($attr_array[$k]) .
|
||||
echo ("<input type=\"text\" size=15 name=\"filter" . strtolower ($attr_array[$k]) .
|
||||
"\" value=\"" . $_POST["filter" . strtolower($attr_array[$k])] . "\">");
|
||||
echo "</th>";
|
||||
}
|
||||
|
|
|
@ -27,11 +27,14 @@ include_once("../../lib/status.inc");
|
|||
include_once("../../lib/account.inc");
|
||||
include_once("../../lib/profiles.inc");
|
||||
include_once("../../lib/ldap.inc");
|
||||
include_once("../../lib/config.inc");
|
||||
|
||||
// start session
|
||||
session_save_path("../../sess");
|
||||
@session_start();
|
||||
|
||||
setlanguage();
|
||||
|
||||
// abort button was pressed in profileuser/~host.php
|
||||
// back to profile editor
|
||||
if ($_POST['abort']) {
|
||||
|
@ -223,8 +226,9 @@ if ($_GET['type'] == "user") {
|
|||
exit;
|
||||
}
|
||||
// save profile
|
||||
saveUserProfile($acct, $profname);
|
||||
echo ("<br><br><p align=\"center\"><big><b>" . _("Profile $profname was saved.") . "</b></big></p>");
|
||||
if (saveUserProfile($acct, $profname)) {
|
||||
echo StatusMessage("INFO", _("Profile was saved."), $profname);
|
||||
}
|
||||
echo ("<br><p><a href=\"profilemain.php\">" . _("Back to Profile Editor") . "</a></p>");
|
||||
}
|
||||
|
||||
|
@ -249,8 +253,9 @@ elseif ($_GET['type'] == "host") {
|
|||
exit;
|
||||
}
|
||||
// save profile
|
||||
saveHostProfile($acct, $profname);
|
||||
echo ("<br><br><p align=\"center\"><big><b>" . _("Profile $profname was saved.") . "</b></big></p>");
|
||||
if (saveHostProfile($acct, $profname)) {
|
||||
echo StatusMessage("INFO", _("Profile was saved."), $profname);
|
||||
}
|
||||
echo ("<br><p><a href=\"profilemain.php\">" . _("Back to Profile Editor") . "</a></p>");
|
||||
}
|
||||
|
||||
|
|
|
@ -25,11 +25,14 @@ $Id$
|
|||
|
||||
include_once("../../lib/profiles.inc");
|
||||
include_once("../../lib/ldap.inc");
|
||||
include_once("../../lib/config.inc");
|
||||
|
||||
// start session
|
||||
session_save_path("../../sess");
|
||||
@session_start();
|
||||
|
||||
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");
|
||||
|
|
|
@ -26,11 +26,14 @@ $Id$
|
|||
include_once("../../lib/profiles.inc");
|
||||
include_once("../../lib/ldap.inc");
|
||||
include_once("../../lib/account.inc");
|
||||
include_once("../../lib/config.inc");
|
||||
|
||||
// start session
|
||||
session_save_path("../../sess");
|
||||
@session_start();
|
||||
|
||||
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");
|
||||
|
|
|
@ -25,11 +25,14 @@ $Id$
|
|||
|
||||
include_once("../../lib/profiles.inc");
|
||||
include_once("../../lib/ldap.inc");
|
||||
include_once("../../lib/config.inc");
|
||||
|
||||
// start session
|
||||
session_save_path("../../sess");
|
||||
@session_start();
|
||||
|
||||
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\">");
|
||||
|
|
|
@ -26,11 +26,14 @@ $Id$
|
|||
include_once("../../lib/profiles.inc");
|
||||
include_once("../../lib/ldap.inc");
|
||||
include_once("../../lib/account.inc");
|
||||
include_once("../../lib/config.inc");
|
||||
|
||||
// start session
|
||||
session_save_path("../../sess");
|
||||
@session_start();
|
||||
|
||||
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");
|
||||
|
|
Loading…
Reference in New Issue