changed subpage handling; fixed another magic_quotes_gpc bug
This commit is contained in:
parent
d1ea4ce0ab
commit
d83df7a446
|
@ -1,9 +1,12 @@
|
||||||
??? 0.5.rc3
|
??? 0.5.rc3
|
||||||
|
- INFO messages no longer prevent changing to subpages of a module
|
||||||
- fixed bugs:
|
- fixed bugs:
|
||||||
-> buttons on account page are better sorted
|
-> buttons on account page are better sorted
|
||||||
-> account module: some problems solved when used for user accounts
|
-> account module: some problems solved when used for user accounts
|
||||||
-> nisMailAlias: fixed missing RDN possibility
|
-> nisMailAlias: fixed missing RDN possibility
|
||||||
-> fixed conflicts when accounts were built with other base modules
|
-> fixed conflicts when accounts were built with other base modules
|
||||||
|
-> Samba 2/3: setting allowed workstations failed
|
||||||
|
-> magic_quotes_gpc = Off prevented editing of accounts
|
||||||
|
|
||||||
|
|
||||||
18.08.2005 0.5.rc2
|
18.08.2005 0.5.rc2
|
||||||
|
|
|
@ -745,27 +745,19 @@ is needed t interact with the user.<br>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
This function processes user inputs. It checks user inputs. It also
|
This function processes user input. It checks user input. It also
|
||||||
saves changes in attributes.<br>
|
saves changes in attributes.<br>
|
||||||
<span style="font-weight: bold;">$post</span> is the $_POST
|
This functions can return two different variables. When 0 is returned
|
||||||
array. Some attributes ar not part of a profile, e.g. uidNumber.
|
everything is ok. If it
|
||||||
If $profile<br>
|
|
||||||
is true attributes wich are not part of a profile won't be checked.<br>
|
|
||||||
LDAP attributes have to be stored in $this->attributes array. First
|
|
||||||
index is the attribute name. Second<br>
|
|
||||||
index is an array of values of an attribute.<br>
|
|
||||||
This functions can return three different variables. When 0 is returned
|
|
||||||
everything is ok. When a string is<br>
|
|
||||||
returned the string is the name of a subpage of the module. If it
|
|
||||||
returns an array the array contains status<br>
|
returns an array the array contains status<br>
|
||||||
messages. First Index is the attribute which has triggered a message.
|
messages. First index is the attribute which has triggered a message.
|
||||||
Second index is an array containing<br>
|
Second index is an array containing status message arrays.<br>
|
||||||
status message arrays.<br>
|
|
||||||
This function must reset $this->triggered_messages when it wants to
|
This function must reset $this->triggered_messages when it wants to
|
||||||
display
|
display
|
||||||
status messages. This can be done with $this->triggered_messages =
|
status messages. This can be done with $this->triggered_messages =
|
||||||
array();<br>
|
array();<br>
|
||||||
<br>
|
<span style="font-weight: bold;">$post</span> is the $_POST
|
||||||
|
array.<br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<h3>2.2.14. process_*<br>
|
<h3>2.2.14. process_*<br>
|
||||||
|
@ -785,7 +777,7 @@ This function has the exact behavoir like process_attributes function.
|
||||||
* is the name of the subpage which<br>
|
* is the name of the subpage which<br>
|
||||||
should be processed.<br>
|
should be processed.<br>
|
||||||
<span style="font-weight: bold;">$post</span> is the $_POST array. It
|
<span style="font-weight: bold;">$post</span> is the $_POST array. It
|
||||||
is needed t interact with the user.<br>
|
is needed to interact with the user.<br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<h3>2.2.15. display_html_attributes($post)<br>
|
<h3>2.2.15. display_html_attributes($post)<br>
|
||||||
|
@ -981,21 +973,46 @@ height attribute for td elements<br>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
Input buttons which should load a different subpage of a module must
|
||||||
|
have a special <span style="font-style: italic;">name </span>attribute:<br>
|
||||||
|
<br>
|
||||||
|
<span style="font-weight: bold;">name</span> => 'form_subpage_' . <span
|
||||||
|
style="font-style: italic;"><module name></span> . '_' . <span
|
||||||
|
style="font-style: italic;"><subpage name></span> . '_' . <span
|
||||||
|
style="font-style: italic;"><button name></span><br>
|
||||||
|
<ul>
|
||||||
|
<li><span style="font-weight: bold;"><module name>:</span> name
|
||||||
|
of this account module (e.g. 'posixAccount')</li>
|
||||||
|
<li><span style="font-weight: bold;"><subpage name>:</span>
|
||||||
|
name of next subpage (e.g. 'attributes')</li>
|
||||||
|
<li><span style="font-weight: bold;"> <button name>:</span> a
|
||||||
|
name to distinguish buttons (e.g. 'ok'/'cancel'/'back')<br>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
<span style="font-weight: bold;">Example:</span><span
|
<span style="font-weight: bold;">Example:</span><span
|
||||||
style="font-family: monospace;"><br>
|
style="font-family: monospace;"><br>
|
||||||
<br>
|
<br>
|
||||||
</span><code>array(<br>
|
</span><code>array(<br>
|
||||||
array(<br>
|
0 => array(<br>
|
||||||
array("kind" => "text", "text" => "This is an
|
0 => array("kind" => "text", "text" =>
|
||||||
|
"This is an
|
||||||
example", "td" => array("colspan" => 3))<br>
|
example", "td" => array("colspan" => 3))<br>
|
||||||
), <br>
|
), <br>
|
||||||
array(<br>
|
1 => array(<br>
|
||||||
array("kind" => "text", "text" => "Input:"),<br>
|
0 => array("kind" => "text", "text" =>
|
||||||
array("kind" => "input", "name" => "myinput",
|
"Input:"),<br>
|
||||||
|
1 => array("kind" => "input", "name" =>
|
||||||
|
"myinput",
|
||||||
"type" => "text"),<br>
|
"type" => "text"),<br>
|
||||||
array("kind" => "help", "value" => "42")<br>
|
2 => array("kind" => "help", "value" => "42")<br>
|
||||||
|
),<br>
|
||||||
|
</code><code> 2 => array(<br>
|
||||||
|
0 => array("kind" => "input", "name" =>
|
||||||
|
'form_subpage_myModule_attributes_back', "value" => _("Back"))<br>
|
||||||
)<br>
|
)<br>
|
||||||
)<br>
|
</code><code>)<br>
|
||||||
</code><br>
|
</code><br>
|
||||||
<br>
|
<br>
|
||||||
<h3><br>
|
<h3><br>
|
||||||
|
|
|
@ -814,7 +814,7 @@ class accountContainer {
|
||||||
$result = array($errors);
|
$result = array($errors);
|
||||||
$stopProcessing = true;
|
$stopProcessing = true;
|
||||||
}
|
}
|
||||||
else $result = 'finish';
|
else $this->subpage = 'finish';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($this->subpage=='finish') {
|
if ($this->subpage=='finish') {
|
||||||
|
@ -849,7 +849,6 @@ class accountContainer {
|
||||||
else $result = call_user_func(array(&$this->module[$this->order[$this->current_page]], 'process_'.$this->subpage), $post);
|
else $result = call_user_func(array(&$this->module[$this->order[$this->current_page]], 'process_'.$this->subpage), $post);
|
||||||
}
|
}
|
||||||
// change to next page
|
// change to next page
|
||||||
if (is_string($result)) $this->subpage = $result; // go to subpage of current module
|
|
||||||
$errorsOccured = false;
|
$errorsOccured = false;
|
||||||
if (is_array($result)) { // messages were returned, check for errors
|
if (is_array($result)) { // messages were returned, check for errors
|
||||||
$errorKeys = array_keys($result);
|
$errorKeys = array_keys($result);
|
||||||
|
@ -862,6 +861,19 @@ class accountContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// go to subpage of current module
|
||||||
|
if (!$errorsOccured) {
|
||||||
|
$postKeys = array_keys($post);
|
||||||
|
for ($p = 0; $p < sizeof($postKeys); $p++) {
|
||||||
|
if (is_string($postKeys[$p]) && (strpos($postKeys[$p], 'form_subpage_' . $this->order[$this->current_page]) === 0)) {
|
||||||
|
$temp = substr($postKeys[$p], strlen($this->order[$this->current_page]) + 14);
|
||||||
|
$temp = explode('_', $temp);
|
||||||
|
if (sizeof($temp) == 2) {
|
||||||
|
$this->subpage = $temp[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (is_int($result) || !$errorsOccured) { // numeric return value means to change to another module
|
if (is_int($result) || !$errorsOccured) { // numeric return value means to change to another module
|
||||||
if ($post['form_main_main']) {
|
if ($post['form_main_main']) {
|
||||||
$this->current_page = 0;
|
$this->current_page = 0;
|
||||||
|
|
|
@ -552,7 +552,7 @@ class inetOrgPerson extends baseModule {
|
||||||
else {
|
else {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Password') ),
|
0 => array('kind' => 'text', 'text' => _('Password') ),
|
||||||
1 => array('kind' => 'input', 'name' => 'changepass', 'type' => 'submit', 'value' => _('Change password')));
|
1 => array('kind' => 'input', 'name' => 'form_subpage_inetOrgPerson_password_open', 'type' => 'submit', 'value' => _('Change password')));
|
||||||
}
|
}
|
||||||
|
|
||||||
$return[] = array(0 => array('kind' => 'text', 'td' => array('colspan' => 3)));
|
$return[] = array(0 => array('kind' => 'text', 'td' => array('colspan' => 3)));
|
||||||
|
@ -637,7 +637,7 @@ class inetOrgPerson extends baseModule {
|
||||||
* @param $post HTTP POST
|
* @param $post HTTP POST
|
||||||
*/
|
*/
|
||||||
function process_password(&$post) {
|
function process_password(&$post) {
|
||||||
if ($post['back']) return 'attributes';
|
if ($post['form_subpage_inetOrgPerson_attributes_back']) return;
|
||||||
$messages = array();
|
$messages = array();
|
||||||
if ($post['userPassword'] != $post['userPassword2']) {
|
if ($post['userPassword'] != $post['userPassword2']) {
|
||||||
$messages['userPassword'][] = $this->messages['userPassword'][0];
|
$messages['userPassword'][] = $this->messages['userPassword'][0];
|
||||||
|
@ -650,8 +650,7 @@ class inetOrgPerson extends baseModule {
|
||||||
$this->attributes['userPassword'][0] = $post['userPassword'];
|
$this->attributes['userPassword'][0] = $post['userPassword'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sizeof($messages) > 0) return $messages;
|
return $messages;
|
||||||
else return 'attributes';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -671,8 +670,8 @@ class inetOrgPerson extends baseModule {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'table', 'value' => array(
|
0 => array('kind' => 'table', 'value' => array(
|
||||||
0 => array(
|
0 => array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Submit'), 'name' => 'submit'),
|
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Submit'), 'name' => 'form_subpage_inetOrgPerson_attributes_submit'),
|
||||||
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'back'),
|
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_inetOrgPerson_attributes_back'),
|
||||||
2 => array('kind' => 'text')))));
|
2 => array('kind' => 'text')))));
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,7 +423,7 @@ class kolabUser extends baseModule {
|
||||||
// delete flag
|
// delete flag
|
||||||
if (!$_SESSION[$this->base]->isNewAccount) {
|
if (!$_SESSION[$this->base]->isNewAccount) {
|
||||||
$returnDelete = array(
|
$returnDelete = array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Mark account for deletion'), 'name' => 'kolabDelete'),
|
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Mark account for deletion'), 'name' => 'form_subpage_kolabUser_deleteUser_open'),
|
||||||
1 => array('kind' => 'help', 'value' => 'deleteFlag'));
|
1 => array('kind' => 'help', 'value' => 'deleteFlag'));
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
array('kind' => 'fieldset', 'legend' => _('Delete Kolab account'), 'value' => array($returnDelete), 'td' => array('colspan' => 3))
|
array('kind' => 'fieldset', 'legend' => _('Delete Kolab account'), 'value' => array($returnDelete), 'td' => array('colspan' => 3))
|
||||||
|
@ -438,7 +438,7 @@ class kolabUser extends baseModule {
|
||||||
* @param array $post HTTP-POST values
|
* @param array $post HTTP-POST values
|
||||||
*/
|
*/
|
||||||
function process_attributes(&$post) {
|
function process_attributes(&$post) {
|
||||||
if ($post['kolabDelete']) return 'deleteUser';
|
if ($post['form_subpage_kolabUser_deleteUser_open']) return;
|
||||||
$this->triggered_messages = array();
|
$this->triggered_messages = array();
|
||||||
$this->attributes['kolabInvitationPolicy'] = array();
|
$this->attributes['kolabInvitationPolicy'] = array();
|
||||||
// country
|
// country
|
||||||
|
@ -598,8 +598,8 @@ class kolabUser extends baseModule {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => ' ', 'td' => array('colspan' => 2)));
|
0 => array('kind' => 'text', 'text' => ' ', 'td' => array('colspan' => 2)));
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Mark account for deletion'), 'name' => 'kolabDeleteConfirm'),
|
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Mark account for deletion'), 'name' => 'form_subpage_kolabUser_attributes_confirm'),
|
||||||
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Cancel'), 'name' => 'kolabDeleteCancel'));
|
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Cancel'), 'name' => 'form_subpage_kolabUser_attributes_cancel'));
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -609,11 +609,10 @@ class kolabUser extends baseModule {
|
||||||
* @param array $post HTTP-POST values
|
* @param array $post HTTP-POST values
|
||||||
*/
|
*/
|
||||||
function process_deleteUser(&$post) {
|
function process_deleteUser(&$post) {
|
||||||
if ($post['kolabDeleteConfirm']) {
|
if ($post['form_subpage_kolabUser_attributes_confirm']) {
|
||||||
// set delete flag
|
// set delete flag
|
||||||
$this->attributes['kolabDeleteflag'][0] = $this->attributes['kolabHomeServer'][0];
|
$this->attributes['kolabDeleteflag'][0] = $this->attributes['kolabHomeServer'][0];
|
||||||
}
|
}
|
||||||
return 'attributes';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -817,7 +817,6 @@ class posixAccount extends baseModule {
|
||||||
if ($_SESSION[$this->base]->isNewAccount && !get_preg($this->attributes['userPassword'][0], 'password'))
|
if ($_SESSION[$this->base]->isNewAccount && !get_preg($this->attributes['userPassword'][0], 'password'))
|
||||||
$triggered_messages['userPassword'][] = $this->messages['userPassword'][1];
|
$triggered_messages['userPassword'][] = $this->messages['userPassword'][1];
|
||||||
}
|
}
|
||||||
|
|
||||||
$temp = $this->input_check();
|
$temp = $this->input_check();
|
||||||
// TODO is this really OK?
|
// TODO is this really OK?
|
||||||
if (is_array($temp)) $triggered_messages = array_merge_recursive($triggered_messages, $temp);
|
if (is_array($temp)) $triggered_messages = array_merge_recursive($triggered_messages, $temp);
|
||||||
|
@ -827,9 +826,6 @@ class posixAccount extends baseModule {
|
||||||
return $triggered_messages;
|
return $triggered_messages;
|
||||||
}
|
}
|
||||||
else $this->triggered_messages = array();
|
else $this->triggered_messages = array();
|
||||||
// Go to additional group page when no error did ocour and button was pressed
|
|
||||||
if ($post['addgroup']) return 'group';
|
|
||||||
if ($post['changepass']) return 'password';
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -850,7 +846,6 @@ class posixAccount extends baseModule {
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
if (isset($post['addgroups_button']) || isset($post['removegroups_button'])) return 'group';
|
if (isset($post['addgroups_button']) || isset($post['removegroups_button'])) return 'group';
|
||||||
if ($post['back']) return 'attributes';
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -860,7 +855,7 @@ class posixAccount extends baseModule {
|
||||||
* @param $post HTTP POST
|
* @param $post HTTP POST
|
||||||
*/
|
*/
|
||||||
function process_password(&$post) {
|
function process_password(&$post) {
|
||||||
if ($post['back']) return 'attributes';
|
if ($post['form_subpage_posixAccount_attributes_back']) return;
|
||||||
$messages = array();
|
$messages = array();
|
||||||
if ($post['userPassword'] != $post['userPassword2']) {
|
if ($post['userPassword'] != $post['userPassword2']) {
|
||||||
$messages['userPassword'][] = $this->messages['userPassword'][0];
|
$messages['userPassword'][] = $this->messages['userPassword'][0];
|
||||||
|
@ -877,7 +872,6 @@ class posixAccount extends baseModule {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sizeof($messages) > 0) return $messages;
|
if (sizeof($messages) > 0) return $messages;
|
||||||
else return 'attributes';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function will create the html-page
|
/* This function will create the html-page
|
||||||
|
@ -935,7 +929,7 @@ class posixAccount extends baseModule {
|
||||||
if ($_SESSION[$this->base]->type=='user') {
|
if ($_SESSION[$this->base]->type=='user') {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Additional groups')),
|
0 => array('kind' => 'text', 'text' => _('Additional groups')),
|
||||||
1 => array('kind' => 'input', 'name' => 'addgroup', 'type' => 'submit', 'value' => _('Edit groups')),
|
1 => array('kind' => 'input', 'name' => 'form_subpage_posixAccount_group_open', 'type' => 'submit', 'value' => _('Edit groups')),
|
||||||
2 => array('kind' => 'help', 'value' => 'addgroup'));
|
2 => array('kind' => 'help', 'value' => 'addgroup'));
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Home directory').'*'),
|
0 => array('kind' => 'text', 'text' => _('Home directory').'*'),
|
||||||
|
@ -960,7 +954,7 @@ class posixAccount extends baseModule {
|
||||||
else {
|
else {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Password') ),
|
0 => array('kind' => 'text', 'text' => _('Password') ),
|
||||||
1 => array('kind' => 'input', 'name' => 'changepass', 'type' => 'submit', 'value' => _('Change password')));
|
1 => array('kind' => 'input', 'name' => 'form_subpage_posixAccount_password_open', 'type' => 'submit', 'value' => _('Change password')));
|
||||||
}
|
}
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Set no password')),
|
0 => array('kind' => 'text', 'text' => _('Set no password')),
|
||||||
|
@ -1038,7 +1032,7 @@ class posixAccount extends baseModule {
|
||||||
))));
|
))));
|
||||||
|
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'back'),
|
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_posixAccount_attributes_back'),
|
||||||
1 => array('kind' => 'text'),
|
1 => array('kind' => 'text'),
|
||||||
2 => array('kind' => 'text'));
|
2 => array('kind' => 'text'));
|
||||||
return $return;
|
return $return;
|
||||||
|
@ -1061,8 +1055,8 @@ class posixAccount extends baseModule {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'table', 'value' => array(
|
0 => array('kind' => 'table', 'value' => array(
|
||||||
0 => array(
|
0 => array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Submit'), 'name' => 'submit'),
|
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Submit'), 'name' => 'form_subpage_posixAccount_attributes_submit'),
|
||||||
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'back'),
|
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_posixAccount_attributes_back'),
|
||||||
2 => array('kind' => 'text')))));
|
2 => array('kind' => 'text')))));
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ class posixGroup extends baseModule {
|
||||||
2 => array ('kind' => 'help', 'value' => 'description'));
|
2 => array ('kind' => 'help', 'value' => 'description'));
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _("Group members").'*'),
|
0 => array('kind' => 'text', 'text' => _("Group members").'*'),
|
||||||
1 => array('kind' => 'input', 'name' => 'adduser', 'type' => 'submit', 'value' => _('Edit members')),
|
1 => array('kind' => 'input', 'name' => 'form_subpage_posixGroup_user_open', 'type' => 'submit', 'value' => _('Edit members')),
|
||||||
2 => array ('kind' => 'help', 'value' => 'adduser'));
|
2 => array ('kind' => 'help', 'value' => 'adduser'));
|
||||||
if ($_SESSION[$this->base]->isNewAccount) {
|
if ($_SESSION[$this->base]->isNewAccount) {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
|
@ -190,7 +190,7 @@ class posixGroup extends baseModule {
|
||||||
else {
|
else {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Password') ),
|
0 => array('kind' => 'text', 'text' => _('Password') ),
|
||||||
1 => array('kind' => 'input', 'name' => 'changepass', 'type' => 'submit', 'value' => _('Change password')));
|
1 => array('kind' => 'input', 'name' => 'form_subpage_posixGroup_password_open', 'type' => 'submit', 'value' => _('Change password')));
|
||||||
}
|
}
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Set no password')),
|
0 => array('kind' => 'text', 'text' => _('Set no password')),
|
||||||
|
@ -259,7 +259,7 @@ class posixGroup extends baseModule {
|
||||||
))));
|
))));
|
||||||
|
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'input', 'name' => 'toattributes' ,'type' => 'submit', 'value' => _('Back') ),
|
0 => array('kind' => 'input', 'name' => 'form_subpage_posixGroup_attributes_back' ,'type' => 'submit', 'value' => _('Back') ),
|
||||||
1 => array('kind' => 'text'),
|
1 => array('kind' => 'text'),
|
||||||
2 => array('kind' => 'text'));
|
2 => array('kind' => 'text'));
|
||||||
return $return;
|
return $return;
|
||||||
|
@ -282,8 +282,8 @@ class posixGroup extends baseModule {
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'table', 'value' => array(
|
0 => array('kind' => 'table', 'value' => array(
|
||||||
0 => array(
|
0 => array(
|
||||||
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Submit'), 'name' => 'submit'),
|
0 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Submit'), 'name' => 'form_subpage_posixGroup_attributes_submit'),
|
||||||
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'back'),
|
1 => array('kind' => 'input', 'type' => 'submit', 'value' => _('Back'), 'name' => 'form_subpage_posixGroup_attributes_back'),
|
||||||
2 => array('kind' => 'text')))));
|
2 => array('kind' => 'text')))));
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
@ -672,9 +672,6 @@ class posixGroup extends baseModule {
|
||||||
return $triggered_messages;
|
return $triggered_messages;
|
||||||
}
|
}
|
||||||
else $this->triggered_messages = array();
|
else $this->triggered_messages = array();
|
||||||
// Go to additional group page when no error did ocour and button was pressed
|
|
||||||
if ($post['adduser']) return 'user';
|
|
||||||
if ($post['changepass']) return 'password';
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -699,8 +696,6 @@ class posixGroup extends baseModule {
|
||||||
elseif (isset($post['removeusers']) && isset($post['removeusers_button'])) { // remove users from list
|
elseif (isset($post['removeusers']) && isset($post['removeusers_button'])) { // remove users from list
|
||||||
$this->attributes['memberUid'] = array_delete($post['removeusers'], $this->attributes['memberUid']);
|
$this->attributes['memberUid'] = array_delete($post['removeusers'], $this->attributes['memberUid']);
|
||||||
}
|
}
|
||||||
if (isset($post['adduser_button']) || isset($post['removeuser_button'])) return 'user';
|
|
||||||
elseif ($post['toattributes']) return 'attributes';
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,7 +706,7 @@ class posixGroup extends baseModule {
|
||||||
* @param $post HTTP POST
|
* @param $post HTTP POST
|
||||||
*/
|
*/
|
||||||
function process_password(&$post) {
|
function process_password(&$post) {
|
||||||
if ($post['back']) return 'attributes';
|
if ($post['form_subpage_posixGroup_attributes_back']) return;
|
||||||
$messages = array();
|
$messages = array();
|
||||||
if ($post['userPassword'] != $post['userPassword2']) {
|
if ($post['userPassword'] != $post['userPassword2']) {
|
||||||
$messages['userPassword'][] = $this->messages['userPassword'][0];
|
$messages['userPassword'][] = $this->messages['userPassword'][0];
|
||||||
|
@ -725,7 +720,6 @@ class posixGroup extends baseModule {
|
||||||
$this->userPassword_nopassword = false;
|
$this->userPassword_nopassword = false;
|
||||||
}
|
}
|
||||||
if (sizeof($messages) > 0) return $messages;
|
if (sizeof($messages) > 0) return $messages;
|
||||||
else return 'attributes';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function returns an array with 3 entries:
|
/* This function returns an array with 3 entries:
|
||||||
|
|
|
@ -487,10 +487,6 @@ class sambaAccount extends baseModule {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_attributes($post) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Write variables into object and do some regexp checks
|
/* Write variables into object and do some regexp checks
|
||||||
*/
|
*/
|
||||||
function process_attributes(&$post) {
|
function process_attributes(&$post) {
|
||||||
|
@ -545,10 +541,10 @@ class sambaAccount extends baseModule {
|
||||||
$post['pwdCanChange_mon'], $post['pwdCanChange_day'], $post['pwdCanChange_yea']);
|
$post['pwdCanChange_mon'], $post['pwdCanChange_day'], $post['pwdCanChange_yea']);
|
||||||
$this->attributes['pwdMustChange'][0] = mktime($post['pwdMustChange_h'], $post['pwdMustChange_m'], $post['pwdMustChange_s'],
|
$this->attributes['pwdMustChange'][0] = mktime($post['pwdMustChange_h'], $post['pwdMustChange_m'], $post['pwdMustChange_s'],
|
||||||
$post['pwdMustChange_mon'], $post['pwdMustChange_day'], $post['pwdMustChange_yea']);
|
$post['pwdMustChange_mon'], $post['pwdMustChange_day'], $post['pwdMustChange_yea']);
|
||||||
$this->attributes['smbHome'][0] = stripslashes($post['smbHome']);
|
$this->attributes['smbHome'][0] = $post['smbHome'];
|
||||||
$this->attributes['homeDrive'][0] = $post['homeDrive'];
|
$this->attributes['homeDrive'][0] = $post['homeDrive'];
|
||||||
$this->attributes['scriptPath'][0] = stripslashes($post['scriptPath']);
|
$this->attributes['scriptPath'][0] = $post['scriptPath'];
|
||||||
$this->attributes['profilePath'][0] = stripslashes($post['profilePath']);
|
$this->attributes['profilePath'][0] = $post['profilePath'];
|
||||||
$rids = array_keys($this->rids);
|
$rids = array_keys($this->rids);
|
||||||
$wrid = false;
|
$wrid = false;
|
||||||
for ($i=0; $i<count($rids); $i++) {
|
for ($i=0; $i<count($rids); $i++) {
|
||||||
|
@ -592,13 +588,13 @@ class sambaAccount extends baseModule {
|
||||||
}
|
}
|
||||||
$this->attributes['smbHome'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['smbHome'][0]);
|
$this->attributes['smbHome'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['smbHome'][0]);
|
||||||
$this->attributes['smbHome'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['smbHome'][0]);
|
$this->attributes['smbHome'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['smbHome'][0]);
|
||||||
if ($this->attributes['smbHome'][0] != stripslashes($post['smbHome'])) $triggered_messages['smbHome'][] = $this->messages['homePath'][1];
|
if ($this->attributes['smbHome'][0] != $post['smbHome']) $triggered_messages['smbHome'][] = $this->messages['homePath'][1];
|
||||||
$this->attributes['scriptPath'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['scriptPath'][0]);
|
$this->attributes['scriptPath'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['scriptPath'][0]);
|
||||||
$this->attributes['scriptPath'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['scriptPath'][0]);
|
$this->attributes['scriptPath'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['scriptPath'][0]);
|
||||||
if ($this->attributes['scriptPath'][0] != stripslashes($post['scriptPath'])) $triggered_messages['scriptPath'][] = $this->messages['logonScript'][1];
|
if ($this->attributes['scriptPath'][0] != $post['scriptPath']) $triggered_messages['scriptPath'][] = $this->messages['logonScript'][1];
|
||||||
$this->attributes['profilePath'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['profilePath'][0]);
|
$this->attributes['profilePath'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['profilePath'][0]);
|
||||||
$this->attributes['profilePath'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['profilePath'][0]);
|
$this->attributes['profilePath'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['profilePath'][0]);
|
||||||
if ($this->attributes['profiletPath'][0] != stripslashes($post['profilePath'])) $triggered_messages['profilePath'][] = $this->messages['profilePath'][1];
|
if ($this->attributes['profiletPath'][0] != $post['profilePath']) $triggered_messages['profilePath'][] = $this->messages['profilePath'][1];
|
||||||
if ( (!$this->attributes['smbHome'][0]=='') && (!get_preg($this->attributes['smbHome'][0], 'UNC')))
|
if ( (!$this->attributes['smbHome'][0]=='') && (!get_preg($this->attributes['smbHome'][0], 'UNC')))
|
||||||
$triggered_messages['smbHome'][] = $this->messages['homePath'][0];
|
$triggered_messages['smbHome'][] = $this->messages['homePath'][0];
|
||||||
if ( (!$this->attributes['scriptPath'][0]=='') && (!get_preg($this->attributes['scriptPath'][0], 'logonscript')))
|
if ( (!$this->attributes['scriptPath'][0]=='') && (!get_preg($this->attributes['scriptPath'][0], 'logonscript')))
|
||||||
|
@ -624,7 +620,6 @@ class sambaAccount extends baseModule {
|
||||||
return $triggered_messages;
|
return $triggered_messages;
|
||||||
}
|
}
|
||||||
else $this->triggered_messages = array();
|
else $this->triggered_messages = array();
|
||||||
if ($post['userWorkstations']) return 'userWorkstations';
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -633,12 +628,12 @@ class sambaAccount extends baseModule {
|
||||||
function process_userWorkstations(&$post) {
|
function process_userWorkstations(&$post) {
|
||||||
// Load attributes
|
// Load attributes
|
||||||
if ($_SESSION[$this->base]->type=='user') {
|
if ($_SESSION[$this->base]->type=='user') {
|
||||||
do { // X-Or, only one if() can be true
|
|
||||||
if (isset($post['availableUserWorkstations']) && isset($post['userWorkstations_add'])) { // Add workstations to list
|
if (isset($post['availableUserWorkstations']) && isset($post['userWorkstations_add'])) { // Add workstations to list
|
||||||
$temp = str_replace(' ', '', $this->attributes['userWorkstations'][0]);
|
$temp = str_replace(' ', '', $this->attributes['userWorkstations'][0]);
|
||||||
$workstations = explode (',', $temp);
|
$workstations = explode (',', $temp);
|
||||||
for ($i=0; $i<count($workstations); $i++)
|
for ($i=0; $i<count($workstations); $i++) {
|
||||||
if ($workstations[$i]=='') unset($workstations[$i]);
|
if ($workstations[$i]=='') unset($workstations[$i]);
|
||||||
|
}
|
||||||
$workstations = array_values($workstations);
|
$workstations = array_values($workstations);
|
||||||
// Add new // Add workstations
|
// Add new // Add workstations
|
||||||
$workstations = array_merge($workstations, $post['availableUserWorkstations']);
|
$workstations = array_merge($workstations, $post['availableUserWorkstations']);
|
||||||
|
@ -653,14 +648,14 @@ class sambaAccount extends baseModule {
|
||||||
for ($i=1; $i<count($workstations); $i++) {
|
for ($i=1; $i<count($workstations); $i++) {
|
||||||
$this->attributes['userWorkstations'][0] = $this->attributes['userWorkstations'][0] . "," . $workstations[$i];
|
$this->attributes['userWorkstations'][0] = $this->attributes['userWorkstations'][0] . "," . $workstations[$i];
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (isset($post['userWorkstations']) && isset($post['userWorkstations_remove'])) { // remove // Add workstations from list
|
elseif (isset($post['userWorkstations']) && isset($post['userWorkstations_remove'])) { // remove // Add workstations from list
|
||||||
// Put all workstations in array
|
// Put all workstations in array
|
||||||
$temp = str_replace(' ', '', $this->attributes['userWorkstations'][0]);
|
$temp = str_replace(' ', '', $this->attributes['userWorkstations'][0]);
|
||||||
$workstations = explode (',', $temp);
|
$workstations = explode (',', $temp);
|
||||||
for ($i=0; $i<count($workstations); $i++)
|
for ($i=0; $i<count($workstations); $i++) {
|
||||||
if ($workstations[$i]=='') unset($workstations[$i]);
|
if ($workstations[$i]=='') unset($workstations[$i]);
|
||||||
|
}
|
||||||
$workstations = array_values($workstations);
|
$workstations = array_values($workstations);
|
||||||
// Remove unwanted workstations from array
|
// Remove unwanted workstations from array
|
||||||
$workstations = array_delete($post['userWorkstations'], $workstations);
|
$workstations = array_delete($post['userWorkstations'], $workstations);
|
||||||
|
@ -669,10 +664,7 @@ class sambaAccount extends baseModule {
|
||||||
for ($i=1; $i<count($workstations); $i++) {
|
for ($i=1; $i<count($workstations); $i++) {
|
||||||
$this->attributes['userWorkstations'][0] = $this->attributes['userWorkstations'][0] . "," . $workstations[$i];
|
$this->attributes['userWorkstations'][0] = $this->attributes['userWorkstations'][0] . "," . $workstations[$i];
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} while(0);
|
|
||||||
if ($post['attributes']) return 'attributes';
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -746,7 +738,7 @@ class sambaAccount extends baseModule {
|
||||||
1 => array ( 'kind' => 'input', 'type' => 'text', 'name' => 'scriptPath', 'size' => '20', 'maxlength' => '255', 'value' => $this->attributes['scriptPath'][0]),
|
1 => array ( 'kind' => 'input', 'type' => 'text', 'name' => 'scriptPath', 'size' => '20', 'maxlength' => '255', 'value' => $this->attributes['scriptPath'][0]),
|
||||||
2 => array ( 'kind' => 'help', 'value' => 'scriptPath' ));
|
2 => array ( 'kind' => 'help', 'value' => 'scriptPath' ));
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Samba workstations') ),
|
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Samba workstations') ),
|
||||||
1 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'userWorkstations', 'value' => _('Edit workstations')),
|
1 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaAccount_userWorkstations_open', 'value' => _('Edit workstations')),
|
||||||
2 => array ( 'kind' => 'help', 'value' => 'userWorkstations' ));
|
2 => array ( 'kind' => 'help', 'value' => 'userWorkstations' ));
|
||||||
|
|
||||||
$names = array_keys($this->rids);
|
$names = array_keys($this->rids);
|
||||||
|
@ -793,10 +785,6 @@ class sambaAccount extends baseModule {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_html_delete(&$post) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This function will create the html-page
|
/* This function will create the html-page
|
||||||
* to show a page with all attributes.
|
* to show a page with all attributes.
|
||||||
* It will output a complete html-table
|
* It will output a complete html-table
|
||||||
|
@ -812,22 +800,21 @@ class sambaAccount extends baseModule {
|
||||||
$userWorkstations = explode (',', $result);
|
$userWorkstations = explode (',', $result);
|
||||||
$availableUserWorkstations = array_delete($userWorkstations, $availableUserWorkstations);
|
$availableUserWorkstations = array_delete($userWorkstations, $availableUserWorkstations);
|
||||||
}
|
}
|
||||||
|
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'fieldset', 'legend' => _("Allowed workstations"), 'value' =>
|
$return[] = array ( 0 => array ( 'kind' => 'fieldset', 'legend' => _("Allowed workstations"), 'value' =>
|
||||||
array ( 0 => array ( 0 => array ('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Allowed workstations"), 'value' =>
|
array ( 0 => array ( 0 => array ('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Allowed workstations"), 'value' =>
|
||||||
array ( 0 => array ( 0 => array ( 'kind' => 'select', 'name' => 'userWorkstations[]', 'size' => '15', 'multiple', 'options' => $userWorkstations)))),
|
array ( 0 => array ( 0 => array ( 'kind' => 'select', 'name' => 'userWorkstations', 'size' => '15', 'multiple' => true, 'options' => $userWorkstations)))),
|
||||||
1 => array ( 'kind' => 'table', 'value' => array ( 0 => array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'userWorkstations_add',
|
1 => array ( 'kind' => 'table', 'value' => array ( 0 => array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'userWorkstations_add',
|
||||||
'value' => '<=')), 1 => array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'userWorkstations_remove', 'value' => '=>' )),
|
'value' => '<=')), 1 => array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'userWorkstations_remove', 'value' => '=>' )),
|
||||||
2 => array ( 0 => array ( 'kind' => 'help', 'value' => 'userWorkstations' )))),
|
2 => array ( 0 => array ( 'kind' => 'help', 'value' => 'userWorkstations' )))),
|
||||||
2 => array ('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Available workstations"), 'value' =>
|
2 => array ('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Available workstations"), 'value' =>
|
||||||
array ( 0 => array ( 0 => array ( 'kind' => 'select', 'name' => 'availableUserWorkstations[]', 'size' => '15', 'multiple', 'options' => $availableUserWorkstations))))
|
array ( 0 => array ( 0 => array ( 'kind' => 'select', 'name' => 'availableUserWorkstations', 'size' => '15', 'multiple' => true, 'options' => $availableUserWorkstations))))
|
||||||
))));
|
))));
|
||||||
|
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'value' => _('Back') ),
|
$return[] = array(
|
||||||
1 => array ( 'kind' => 'text'),
|
0 => array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaAccount_attributes_back', 'value' => _('Back')),
|
||||||
2 => array ('kind' => 'text'));
|
1 => array('kind' => 'text'),
|
||||||
|
2 => array('kind' => 'text'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -537,10 +537,10 @@ class sambaSamAccount extends baseModule {
|
||||||
$post['sambaPwdCanChange_mon'], $post['sambaPwdCanChange_day'], $post['sambaPwdCanChange_yea']);
|
$post['sambaPwdCanChange_mon'], $post['sambaPwdCanChange_day'], $post['sambaPwdCanChange_yea']);
|
||||||
$this->attributes['sambaPwdMustChange'][0] = mktime($post['sambaPwdMustChange_h'], $post['sambaPwdMustChange_m'], $post['sambaPwdMustChange_s'],
|
$this->attributes['sambaPwdMustChange'][0] = mktime($post['sambaPwdMustChange_h'], $post['sambaPwdMustChange_m'], $post['sambaPwdMustChange_s'],
|
||||||
$post['sambaPwdMustChange_mon'], $post['sambaPwdMustChange_day'], $post['sambaPwdMustChange_yea']);
|
$post['sambaPwdMustChange_mon'], $post['sambaPwdMustChange_day'], $post['sambaPwdMustChange_yea']);
|
||||||
$this->attributes['sambaHomePath'][0] = stripslashes($post['sambaHomePath']);
|
$this->attributes['sambaHomePath'][0] = $post['sambaHomePath'];
|
||||||
$this->attributes['sambaHomeDrive'][0] = $post['sambaHomeDrive'];
|
$this->attributes['sambaHomeDrive'][0] = $post['sambaHomeDrive'];
|
||||||
$this->attributes['sambaLogonScript'][0] = stripslashes($post['sambaLogonScript']);
|
$this->attributes['sambaLogonScript'][0] = $post['sambaLogonScript'];
|
||||||
$this->attributes['sambaProfilePath'][0] = stripslashes($post['sambaProfilePath']);
|
$this->attributes['sambaProfilePath'][0] = $post['sambaProfilePath'];
|
||||||
$rids = array_keys($this->rids);
|
$rids = array_keys($this->rids);
|
||||||
$wrid = false;
|
$wrid = false;
|
||||||
for ($i=0; $i<count($rids); $i++) {
|
for ($i=0; $i<count($rids); $i++) {
|
||||||
|
@ -601,13 +601,13 @@ class sambaSamAccount extends baseModule {
|
||||||
// Check values
|
// Check values
|
||||||
$this->attributes['sambaHomePath'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['sambaHomePath'][0]);
|
$this->attributes['sambaHomePath'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['sambaHomePath'][0]);
|
||||||
$this->attributes['sambaHomePath'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['sambaHomePath'][0]);
|
$this->attributes['sambaHomePath'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['sambaHomePath'][0]);
|
||||||
if ($this->attributes['sambaHomePath'][0] != stripslashes($post['sambaHomePath'])) $triggered_messages['sambaHomePath'][] = $this->messages['homePath'][1];
|
if ($this->attributes['sambaHomePath'][0] != $post['sambaHomePath']) $triggered_messages['sambaHomePath'][] = $this->messages['homePath'][1];
|
||||||
$this->attributes['sambaLogonScript'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['sambaLogonScript'][0]);
|
$this->attributes['sambaLogonScript'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['sambaLogonScript'][0]);
|
||||||
$this->attributes['sambaLogonScript'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['sambaLogonScript'][0]);
|
$this->attributes['sambaLogonScript'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['sambaLogonScript'][0]);
|
||||||
if ($this->attributes['sambaLogonScript'][0] != stripslashes($post['sambaLogonScript'])) $triggered_messages['sambaLogonScript'][] = $this->messages['logonScript'][1];
|
if ($this->attributes['sambaLogonScript'][0] != $post['sambaLogonScript']) $triggered_messages['sambaLogonScript'][] = $this->messages['logonScript'][1];
|
||||||
$this->attributes['sambaProfilePath'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['sambaProfilePath'][0]);
|
$this->attributes['sambaProfilePath'][0] = str_replace('$user', $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0], $this->attributes['sambaProfilePath'][0]);
|
||||||
$this->attributes['sambaProfilePath'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['sambaProfilePath'][0]);
|
$this->attributes['sambaProfilePath'][0] = str_replace('$group', $_SESSION['cache']->getgrnam($_SESSION[$this->base]->module['posixAccount']->attributes['gidNumber'][0]), $this->attributes['sambaProfilePath'][0]);
|
||||||
if ($this->attributes['sambaProfilePath'][0] != stripslashes($post['sambaProfilePath'])) $triggered_messages['sambaProfilePath'][] = $this->messages['profilePath'][1];
|
if ($this->attributes['sambaProfilePath'][0] != $post['sambaProfilePath']) $triggered_messages['sambaProfilePath'][] = $this->messages['profilePath'][1];
|
||||||
if ( (!$this->attributes['sambaHomePath'][0]=='') && (!get_preg($this->attributes['sambaHomePath'][0], 'UNC')))
|
if ( (!$this->attributes['sambaHomePath'][0]=='') && (!get_preg($this->attributes['sambaHomePath'][0], 'UNC')))
|
||||||
$triggered_messages['sambaHomePath'][] = $this->messages['homePath'][0];
|
$triggered_messages['sambaHomePath'][] = $this->messages['homePath'][0];
|
||||||
if ( (!$this->attributes['sambaLogonScript'][0]=='') && (!get_preg($this->attributes['sambaLogonScript'][0], 'logonscript')))
|
if ( (!$this->attributes['sambaLogonScript'][0]=='') && (!get_preg($this->attributes['sambaLogonScript'][0], 'logonscript')))
|
||||||
|
@ -626,8 +626,6 @@ class sambaSamAccount extends baseModule {
|
||||||
return $triggered_messages;
|
return $triggered_messages;
|
||||||
}
|
}
|
||||||
else $this->triggered_messages = array();
|
else $this->triggered_messages = array();
|
||||||
if ($post['sambaUserWorkstations']) return 'sambaUserWorkstations';
|
|
||||||
if ($post['logonHours']) return 'logonHours';
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,7 +673,6 @@ class sambaSamAccount extends baseModule {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while(0);
|
} while(0);
|
||||||
if ($post['attributes']) return 'attributes';
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -687,7 +684,7 @@ class sambaSamAccount extends baseModule {
|
||||||
* @return string next page name (attributes or logonHours)
|
* @return string next page name (attributes or logonHours)
|
||||||
*/
|
*/
|
||||||
function process_logonHours(&$post) {
|
function process_logonHours(&$post) {
|
||||||
if ($post['abort']) return 'attributes';
|
if ($post['form_subpage_sambaSamAccount_attributes_abort']) return;
|
||||||
// set new logon hours
|
// set new logon hours
|
||||||
$logonHours = '';
|
$logonHours = '';
|
||||||
for ($i = 0; $i < 7; $i++) {
|
for ($i = 0; $i < 7; $i++) {
|
||||||
|
@ -712,7 +709,6 @@ class sambaSamAccount extends baseModule {
|
||||||
$logonHoursNew = $logonHoursNew . $hex;
|
$logonHoursNew = $logonHoursNew . $hex;
|
||||||
}
|
}
|
||||||
$this->attributes['sambaLogonHours'][0] = $logonHoursNew;
|
$this->attributes['sambaLogonHours'][0] = $logonHoursNew;
|
||||||
if ($post['submit']) return 'attributes';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function will create the html-page
|
/* This function will create the html-page
|
||||||
|
@ -794,7 +790,7 @@ class sambaSamAccount extends baseModule {
|
||||||
1 => array ( 'kind' => 'input', 'type' => 'text', 'name' => 'sambaLogonScript', 'size' => '20', 'maxlength' => '255', 'value' => $this->attributes['sambaLogonScript'][0]),
|
1 => array ( 'kind' => 'input', 'type' => 'text', 'name' => 'sambaLogonScript', 'size' => '20', 'maxlength' => '255', 'value' => $this->attributes['sambaLogonScript'][0]),
|
||||||
2 => array ( 'kind' => 'help', 'value' => 'sambaLogonScript' ));
|
2 => array ( 'kind' => 'help', 'value' => 'sambaLogonScript' ));
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Samba workstations') ),
|
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Samba workstations') ),
|
||||||
1 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'sambaUserWorkstations', 'value' => _('Edit workstations')),
|
1 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaSamAccount_sambaUserWorkstations_open', 'value' => _('Edit workstations')),
|
||||||
2 => array ( 'kind' => 'help', 'value' => 'sambaUserWorkstations' ));
|
2 => array ( 'kind' => 'help', 'value' => 'sambaUserWorkstations' ));
|
||||||
|
|
||||||
$names = array_keys($this->rids);
|
$names = array_keys($this->rids);
|
||||||
|
@ -836,7 +832,7 @@ class sambaSamAccount extends baseModule {
|
||||||
// logon hours
|
// logon hours
|
||||||
if ($_SESSION[$this->base]->type=='user') {
|
if ($_SESSION[$this->base]->type=='user') {
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Logon hours') ),
|
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Logon hours') ),
|
||||||
1 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'logonHours', 'value' => _('Edit logon hours')),
|
1 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaSamAccount_logonHours_open', 'value' => _('Edit logon hours')),
|
||||||
2 => array ( 'kind' => 'help', 'value' => 'logonHours' ));
|
2 => array ( 'kind' => 'help', 'value' => 'logonHours' ));
|
||||||
}
|
}
|
||||||
// reset host password
|
// reset host password
|
||||||
|
@ -849,10 +845,6 @@ class sambaSamAccount extends baseModule {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_html_delete(&$post) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This function will create the html-page
|
/* This function will create the html-page
|
||||||
* to show a page with all attributes.
|
* to show a page with all attributes.
|
||||||
* It will output a complete html-table
|
* It will output a complete html-table
|
||||||
|
@ -869,17 +861,17 @@ class sambaSamAccount extends baseModule {
|
||||||
$availableUserWorkstations = array_delete($userWorkstations, $availableUserWorkstations);
|
$availableUserWorkstations = array_delete($userWorkstations, $availableUserWorkstations);
|
||||||
}
|
}
|
||||||
|
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'fieldset', 'legend' => _("Allowed workstations"), 'value' =>
|
$return[] = array( 0 => array ( 'kind' => 'fieldset', 'legend' => _("Allowed workstations"), 'value' =>
|
||||||
array ( 0 => array ( 0 => array ('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Allowed workstations"), 'value' =>
|
array ( 0 => array ( 0 => array ('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Allowed workstations"), 'value' =>
|
||||||
array ( 0 => array ( 0 => array ( 'kind' => 'select', 'name' => 'sambaUserWorkstations[]', 'size' => '15', 'multiple', 'options' => $userWorkstations)))),
|
array ( 0 => array ( 0 => array ( 'kind' => 'select', 'name' => 'sambaUserWorkstations', 'size' => '15', 'multiple' => true, 'options' => $userWorkstations)))),
|
||||||
1 => array ( 'kind' => 'table', 'value' => array ( 0 => array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'sambaUserWorkstations_add',
|
1 => array ( 'kind' => 'table', 'value' => array ( 0 => array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'sambaUserWorkstations_add',
|
||||||
'value' => '<=')), 1 => array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'sambaUserWorkstations_remove', 'value' => '=>' )),
|
'value' => '<=')), 1 => array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'name' => 'sambaUserWorkstations_remove', 'value' => '=>' )),
|
||||||
2 => array ( 0 => array ( 'kind' => 'help', 'value' => 'sambaUserWorkstations' )))),
|
2 => array ( 0 => array ( 'kind' => 'help', 'value' => 'sambaUserWorkstations' )))),
|
||||||
2 => array ('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Available workstations"), 'value' =>
|
2 => array ('kind' => 'fieldset', 'td' => array ('valign' => 'top'), 'legend' => _("Available workstations"), 'value' =>
|
||||||
array ( 0 => array ( 0 => array ( 'kind' => 'select', 'name' => 'availableSambaUserWorkstations[]', 'size' => '15', 'multiple', 'options' => $availableUserWorkstations))))
|
array ( 0 => array ( 0 => array ( 'kind' => 'select', 'name' => 'availableSambaUserWorkstations', 'size' => '15', 'multiple' => true, 'options' => $availableUserWorkstations))))
|
||||||
))));
|
))));
|
||||||
|
|
||||||
$return[] = array ( 0 => array ( 'kind' => 'input', 'type' => 'submit', 'value' => _('Back') ),
|
$return[] = array ( 0 => array ( 'kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_attributes_back', 'type' => 'submit', 'value' => _('Back') ),
|
||||||
1 => array ( 'kind' => 'text'),
|
1 => array ( 'kind' => 'text'),
|
||||||
2 => array ('kind' => 'text'));
|
2 => array ('kind' => 'text'));
|
||||||
}
|
}
|
||||||
|
@ -953,8 +945,8 @@ class sambaSamAccount extends baseModule {
|
||||||
array_unshift($timezones, 'GMT-' . $t);
|
array_unshift($timezones, 'GMT-' . $t);
|
||||||
}
|
}
|
||||||
$return[] = array(
|
$return[] = array(
|
||||||
0 => array('kind' => 'input', 'name' => 'submit', 'type' => 'submit', 'value' => _('Submit'), 'td' => array('align' => 'right')),
|
0 => array('kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_attributes_submit', 'type' => 'submit', 'value' => _('Submit'), 'td' => array('align' => 'right')),
|
||||||
1 => array('kind' => 'input', 'name' => 'abort', 'type' => 'submit', 'value' => _('Abort'), 'td' => array('align' => 'left')),
|
1 => array('kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_attributes_abort', 'type' => 'submit', 'value' => _('Abort'), 'td' => array('align' => 'left')),
|
||||||
2 => array('kind' => 'text', 'td' => array('colspan' => 2)),
|
2 => array('kind' => 'text', 'td' => array('colspan' => 2)),
|
||||||
3 => array('kind' => 'table', 'td' => array('colspan' => 4, 'align' => 'right'), 'value' => array(0 => array(
|
3 => array('kind' => 'table', 'td' => array('colspan' => 4, 'align' => 'right'), 'value' => array(0 => array(
|
||||||
0 => array('kind' => 'text', 'text' => _('Time zone')),
|
0 => array('kind' => 'text', 'text' => _('Time zone')),
|
||||||
|
|
|
@ -67,10 +67,18 @@ if ($_GET['DN']) {
|
||||||
else if (count($_POST)==0) {
|
else if (count($_POST)==0) {
|
||||||
$type = str_replace("\'", '', $_GET['type']);
|
$type = str_replace("\'", '', $_GET['type']);
|
||||||
if ($_GET['type'] == $type) $type = str_replace("'", '',$_GET['type']);
|
if ($_GET['type'] == $type) $type = str_replace("'", '',$_GET['type']);
|
||||||
if ($_GET['DN'] == $DN) $DN = str_replace("'", '',$_GET['DN']);
|
|
||||||
$_SESSION['account'] = new accountContainer($type, 'account');
|
$_SESSION['account'] = new accountContainer($type, 'account');
|
||||||
$_SESSION['account']->new_account();
|
$_SESSION['account']->new_account();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove double slashes if magic quotes are on
|
||||||
|
if (get_magic_quotes_gpc() == 1) {
|
||||||
|
$postKeys = array_keys($_POST);
|
||||||
|
for ($i = 0; $i < sizeof($postKeys); $i++) {
|
||||||
|
if (is_string($_POST[$postKeys[$i]])) $_POST[$postKeys[$i]] = stripslashes($_POST[$postKeys[$i]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// show account page
|
// show account page
|
||||||
$_SESSION['account']->continue_main($_POST);
|
$_SESSION['account']->continue_main($_POST);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue