hpdl
|
1200
|
1
|
<?php
|
|
2
|
/*
|
|
3
|
$Id: $
|
|
4
|
|
|
5
|
osCommerce, Open Source E-Commerce Solutions
|
|
6
|
http://www.oscommerce.com
|
|
7
|
|
hpdl
|
1446
|
8
|
Copyright (c) 2007 osCommerce
|
hpdl
|
1200
|
9
|
|
hpdl
|
1497
|
10
|
This program is free software; you can redistribute it and/or modify
|
|
11
|
it under the terms of the GNU General Public License v2 (1991)
|
|
12
|
as published by the Free Software Foundation.
|
hpdl
|
1200
|
13
|
*/
|
|
14
|
|
|
15
|
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/access');
|
|
16
|
$osC_DirectoryListing->setIncludeDirectories(false);
|
hpdl
|
1604
|
17
|
$osC_DirectoryListing->setCheckExtension('php');
|
hpdl
|
1200
|
18
|
|
|
19
|
$access_modules_array = array();
|
|
20
|
|
|
21
|
foreach ($osC_DirectoryListing->getFiles() as $file) {
|
|
22
|
$module = substr($file['name'], 0, strrpos($file['name'], '.'));
|
|
23
|
|
|
24
|
if (!class_exists('osC_Access_' . ucfirst($module))) {
|
hpdl
|
1472
|
25
|
$osC_Language->loadIniFile('modules/access/' . $file['name']);
|
hpdl
|
1200
|
26
|
include($osC_DirectoryListing->getDirectory() . '/' . $file['name']);
|
|
27
|
}
|
|
28
|
|
|
29
|
$module = 'osC_Access_' . ucfirst($module);
|
|
30
|
$module = new $module();
|
|
31
|
|
|
32
|
$access_modules_array[osC_Access::getGroupTitle( $module->getGroup() )][] = array('id' => $module->getModule(),
|
|
33
|
'text' => $module->getTitle());
|
|
34
|
}
|
|
35
|
|
|
36
|
ksort($access_modules_array);
|
|
37
|
|
|
38
|
$osC_ObjectInfo = new osC_ObjectInfo(osC_Administrators_Admin::getData($_GET['aID']));
|
|
39
|
?>
|
|
40
|
|
hpdl
|
1405
|
41
|
<h1><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule()), $osC_Template->getPageTitle()); ?></h1>
|
hpdl
|
1200
|
42
|
|
|
43
|
<?php
|
|
44
|
if ($osC_MessageStack->size($osC_Template->getModule()) > 0) {
|
hpdl
|
1845
|
45
|
echo $osC_MessageStack->get($osC_Template->getModule());
|
hpdl
|
1200
|
46
|
}
|
|
47
|
?>
|
|
48
|
|
hpdl
|
1475
|
49
|
<div class="infoBoxHeading"><?php echo osc_icon('edit.png') . ' ' . $osC_ObjectInfo->get('user_name'); ?></div>
|
hpdl
|
1200
|
50
|
<div class="infoBoxContent">
|
hpdl
|
1405
|
51
|
<form name="aEdit" action="<?php echo osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page'] . '&aID=' . $osC_ObjectInfo->get('id') . '&action=save'); ?>" method="post">
|
hpdl
|
1200
|
52
|
|
hpdl
|
1446
|
53
|
<p><?php echo $osC_Language->get('introduction_edit_administrator'); ?></p>
|
hpdl
|
1200
|
54
|
|
hpdl
|
1446
|
55
|
<p><?php echo '<b>' . $osC_Language->get('field_username') . '</b><br />' . osc_draw_input_field('user_name', $osC_ObjectInfo->get('user_name'), 'style="width: 100%;"'); ?></p>
|
|
56
|
<p><?php echo '<b>' . $osC_Language->get('field_password') . '</b><br />' . osc_draw_password_field('user_password', 'style="width: 100%;"'); ?></p>
|
hpdl
|
1200
|
57
|
|
|
58
|
<?php
|
|
59
|
echo '<ul style="list-style-type: none; padding-left: 0;">' .
|
hpdl
|
1446
|
60
|
' <li>' . osc_draw_checkbox_field('modules[]', '*', in_array('*', $osC_ObjectInfo->get('access_modules')), 'id="access_globaladmin"') . ' <label for="access_globaladmin"><b>' . $osC_Language->get('global_access') . '</b></label></li>' .
|
hpdl
|
1200
|
61
|
'</ul>' .
|
|
62
|
'<ul style="list-style-type: none; padding-left: 0;">';
|
|
63
|
|
|
64
|
foreach ( $access_modules_array as $group => $modules ) {
|
|
65
|
echo ' <li><b>' . $group . '</b>' .
|
|
66
|
' <ul style="list-style-type: none; padding-left: 15px;">';
|
|
67
|
|
|
68
|
foreach ($modules as $module) {
|
|
69
|
echo ' <li>' . osc_draw_checkbox_field('modules[]', $module['id'], in_array($module['id'], $osC_ObjectInfo->get('access_modules')), 'id="access_' . $module['id'] . '"') . ' <label for="access_' . $module['id'] . '" class="fieldLabel">' . $module['text'] . '</label></li>';
|
|
70
|
}
|
|
71
|
|
|
72
|
echo ' </ul>' .
|
|
73
|
' </li>';
|
|
74
|
}
|
|
75
|
|
|
76
|
echo '</ul>';
|
|
77
|
?>
|
|
78
|
|
hpdl
|
1475
|
79
|
<p align="center"><?php echo osc_draw_hidden_field('subaction', 'confirm') . '<input type="submit" value="' . $osC_Language->get('button_save') . '" class="operationButton" /> <input type="button" value="' . $osC_Language->get('button_cancel') . '" onclick="document.location.href=\'' . osc_href_link_admin(FILENAME_DEFAULT, $osC_Template->getModule() . '&page=' . $_GET['page']) . '\';" class="operationButton" />'; ?></p>
|
hpdl
|
1200
|
80
|
|
|
81
|
</form>
|
|
82
|
</div>
|