Added support 4 status.php

This commit is contained in:
katagia 2003-05-03 19:15:23 +00:00
parent 7efe138d3a
commit 78eca235bc
2 changed files with 23 additions and 24 deletions

View File

@ -815,7 +815,9 @@ function createhost() { // Will create the LDAP-Host
if ($success) ldap_delete($_SESSION['ldap']->server(),$_SESSION['account_old']->general_dn); if ($success) ldap_delete($_SESSION['ldap']->server(),$_SESSION['account_old']->general_dn);
} }
if (!$success) return 5; if (!$success) return 5;
if ($attr['uidNumber']!=$_SESSION['account_old']->general_uidNumber) echo ('find / -uid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chown ' . $_SESSION['account']->general_uidNumber . ' {} \;'); if ($attr['uidNumber']!=$_SESSION['account_old']->general_uidNumber) StatusMessage('INFO', _('Attention:'),
_('You have to run the following command if yuo want to preserve filepermission: ').
('find / -uid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chown ' . $_SESSION['account']->general_uidNumber . ' {} \;'));
// Write Groupmemberchips // Write Groupmemberchips
$allgroups = $_SESSION['account']->general_groupadd; $allgroups = $_SESSION['account']->general_groupadd;
if (!in_array($_SESSION['account']->general_group, $allgroups)) $allgroups[] = $_SESSION['account']->general_group; if (!in_array($_SESSION['account']->general_group, $allgroups)) $allgroups[] = $_SESSION['account']->general_group;

View File

@ -24,9 +24,10 @@ $Id$
*/ */
include_once('../lib/account.inc'); // File with custom functions include_once('../lib/account.inc'); // File with custom functions
include_once('../lib/config.inc'); include_once('../lib/config.inc'); // File with configure-functions
include_once('../lib/ldap.inc'); include_once('../lib/ldap.inc'); // LDAP-functions
include_once('../lib/profiles.inc'); include_once('../lib/profiles.inc'); // functions to load and save profiles
include_once('../templates/status.php'); // Return error-message
registervars(); // Register all needed variables in session and register session registervars(); // Register all needed variables in session and register session
$error = "0"; $error = "0";
@ -218,11 +219,10 @@ echo '</title>
</head><body> </head><body>
<form action="account.php" method="post"> <form action="account.php" method="post">
<meta http-equiv="pragma" content="no-cache"> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="cache-control" content="no-cache">';
<table rules="all" class="account" width="100%"> if ($error != "0") StatusMessage('ERROR', _('Invalid Value!'), $error);
<tr><td>'; echo '<table rules="all" class="account" width="100%">
if ($error != "0") echo $error; <tr><td></td></tr>';
echo '</td></tr>';
if (!$select_local) $select_local='general'; if (!$select_local) $select_local='general';
@ -715,27 +715,24 @@ switch ($select_local) {
switch ( $_SESSION['type2'] ) { switch ( $_SESSION['type2'] ) {
case 'user' : case 'user' :
if (($_SESSION['modify']==1) && ($_SESSION['account']->general_uidNumber != $_SESSION['account_old']->general_uidNumber)) { if (($_SESSION['modify']==1) && ($_SESSION['account']->general_uidNumber != $_SESSION['account_old']->general_uidNumber)) {
echo '<tr><td>'; echo '<tr>';
echo _('UID-number has changed. You have to run the following command as root in order to change existing file-permissions:'); StatusMessage ('INFO', _('UID-number has changed. You have to run the following command as root in order to change existing file-permissions:'),
echo '</td><td>'; 'find / -gid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chown ' . $_SESSION['account']->general_uidNumber . ' {} \;');
echo 'find / -gid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chown ' . $_SESSION['account']->general_uidNumber . ' {} \;'; echo '</tr>';
echo '</td></tr>';
} }
if (($_SESSION['modify']==1) && ($_SESSION['account']->general_homedir != $_SESSION['account_old']->general_homedir)) { if (($_SESSION['modify']==1) && ($_SESSION['account']->general_homedir != $_SESSION['account_old']->general_homedir)) {
echo '<tr><td>'; echo '<tr>';
echo _('Home Directory has changed. You have to run the following command as root in order to change the existing homedirectory:'); StatusMessage ('INFO', _('Home Directory has changed. You have to run the following command as root in order to change the existing homedirectory:'),
echo '</td><td>'; 'mv ' . $_SESSION['account_old' ]->general_homedir . ' ' . $_SESSION['account']->general_homedir);
echo 'mv ' . $_SESSION['account_old' ]->general_homedir . ' ' . $_SESSION['account']->general_homedir; echo '</tr>';
echo '</td></tr>';
} }
break; break;
case 'group' : case 'group' :
if (($_SESSION['modify']==1) && ($_SESSION['account']->general_uidNumber != $_SESSION['account_old']->general_uidNumber)) { if (($_SESSION['modify']==1) && ($_SESSION['account']->general_uidNumber != $_SESSION['account_old']->general_uidNumber)) {
echo '<tr><td>'; echo '<tr>';
echo _('GID-number has changed. You have to run the following command as root in order to change existing file-permissions:'); StausMessage ('INFO', _('GID-number has changed. You have to run the following command as root in order to change existing file-permissions:'),
echo '</td><td>'; 'find / -gid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chgrp ' . $_SESSION['account']->general_uidNumber . ' {} \;');
echo 'find / -gid ' . $_SESSION['account_old' ]->general_uidNumber . ' -exec chgrp ' . $_SESSION['account']->general_uidNumber . ' {} \;'; echo '</tr>';
echo '</td></tr>';
echo '<tr><td>'; echo '<tr><td>';
echo '<input name="f_final_changegids" type="checkbox"'; echo '<input name="f_final_changegids" type="checkbox"';
if ($_SESSION['account']->final_changegids) echo ' checked '; if ($_SESSION['account']->final_changegids) echo ' checked ';