"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/web/lib/plugins/ldap/pages/ldapmanagementpage.class.php" between
fogproject-1.5.5.tar.gz and fogproject-1.5.6.tar.gz

About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.

ldapmanagementpage.class.php  (fogproject-1.5.5):ldapmanagementpage.class.php  (fogproject-1.5.6)
skipping to change at line 51 skipping to change at line 51
* @return void * @return void
*/ */
public function __construct($name = '') public function __construct($name = '')
{ {
$this->name = _('LDAP Management'); $this->name = _('LDAP Management');
self::$foglang['ExportLdap'] = _('Export LDAPs'); self::$foglang['ExportLdap'] = _('Export LDAPs');
self::$foglang['ImportLdap'] = _('Import LDAPs'); self::$foglang['ImportLdap'] = _('Import LDAPs');
parent::__construct($name); parent::__construct($name);
global $id; global $id;
global $sub; global $sub;
$this->menu['PluginConfiguration'] = _('Plugin Configuration');
switch ($sub) {
case 'PluginConfiguration':
parent::__construct($this->name);
break;
default:
}
if ($id) { if ($id) {
$this->subMenu = array( $this->subMenu = array(
"$this->linkformat#ldap-gen" => self::$foglang['General'], "$this->linkformat#ldap-gen" => self::$foglang['General'],
"$this->delformat" => self::$foglang['Delete'], "$this->delformat" => self::$foglang['Delete'],
); );
$this->notes = array( $this->notes = array(
_('LDAP Connection Name') => $this->obj->get('name'), _('LDAP Connection Name') => $this->obj->get('name'),
_('LDAP Server Address') => $this->obj->get('address'), _('LDAP Server Address') => $this->obj->get('address'),
); );
} }
skipping to change at line 208 skipping to change at line 215
_('Base Only'), _('Base Only'),
_('Subtree Only'), _('Subtree Only'),
_('Subree and Below') _('Subree and Below')
); );
$searchSel = self::selectForm( $searchSel = self::selectForm(
'searchScope', 'searchScope',
$searchScopes, $searchScopes,
$searchScope, $searchScope,
true true
); );
$ports = array(389, 636); $ports = self::getSetting('LDAP_PORTS');
$ports = preg_replace('#\s+#', '', $ports);
$ports = explode(',', $ports);
$portssel = self::selectForm( $portssel = self::selectForm(
'port', 'port',
$ports, $ports,
$port $port
); );
$useGroupMatch = isset($_POST['useGroupMatch']); $useGroupMatch = isset($_POST['useGroupMatch']);
$useMatch = ( $useMatch = (
$useGroupMatch ? $useGroupMatch ?
' checked' : ' checked' :
'' ''
skipping to change at line 997 skipping to change at line 1006
); );
} }
self::$HookManager self::$HookManager
->processEvent( ->processEvent(
$hook, $hook,
array('LDAP' => &$this->obj) array('LDAP' => &$this->obj)
); );
echo $msg; echo $msg;
exit; exit;
} }
public function PluginConfiguration()
{
unset(
$this->form,
$this->data,
$this->headerData,
$this->templates,
$this->attributes
);
$this->title = _('Plugin Configuration');
$this->attributes = array(
array('class' => 'col-xs-4'),
array('class' => 'col-xs-8 form-group'),
);
$this->templates = array(
'${field}',
'${input}',
);
$filter = self::getSetting('FOG_USER_FILTER');
$filter = preg_replace('#\s+#', '', $filter);
$ports = self::getSetting('LDAP_PORTS');
$ports = preg_replace('#\s+#', '', $ports);
$fields = array(
'<label for="filter">'
. _('User Filter')
. '</label>' => '<div class="input-group">'
. '<input type="text" name="filter" id="filter" class="form-control"
value="'
. $filter
. '"/>'
. '</div>',
'<label for="ports">'
. _('LDAP Ports')
. '</label>' => '<div class="input-group">'
. '<input type="text" name="ports" id="ports" class="form-control" v
alue="'
. $ports
. '"/>'
. '</div>',
'<label for="update">'
. _('Update')
. '</label>' => '<button type="submit" name="update" id="update" '
. 'class="btn btn-info btn-block">'
. _('Update')
. '</button>'
);
array_walk($fields, $this->fieldsToData);
self::$HookManager
->processEvent(
'LDAP_CONFIG',
array(
'headerData' => &$this->headerData,
'data' => &$this->data,
'templates' => &$this->templates,
'attributes' => &$this->attributes
)
);
unset($fields);
echo '<div class="col-xs-9">';
echo '<div class="panel panel-info">';
echo '<div class="panel-heading text-center">';
echo '<h4 class="title">';
echo $this->title;
echo '</h4>';
echo '</div>';
echo '<div class="panel-body">';
echo '<form class="form-horizontal" method="post" action="'
. $this->formAction
. '">';
$this->render(12);
echo '</form>';
echo '</div>';
echo '</div>';
echo '</div>';
unset(
$this->data,
$this->form,
$this->headerData,
$this->templates,
$this->attributes
);
}
public function PluginConfigurationPost()
{
$filter = filter_input(
INPUT_POST,
'filter'
);
$ports = filter_input(
INPUT_POST,
'ports'
);
try {
if (in_array(false, array_map(function ($v) {
return is_numeric($v);
}, explode(',', $filter)))||
in_array(false, array_map(function ($v) {
return is_numeric($v);
}, explode(',', $ports)))) {
$msg = json_encode(
array(
'error' => _('Not all elements in filter
or ports setting are integer'),
'title' => _('Settings Update Fail')
)
);
} else {
self::setSetting('LDAP_PORTS', $ports);
self::setSetting('FOG_USER_FILTER', $filter);
$msg = json_encode(
array(
'msg' => _('Settings successfully stored
!'),
'title' => _('Settings Update Success')
)
);
}
} catch (Exception $e) {
$msg = json_encode(
array(
'error' => $e->getMessage(),
'title' => _('Settings Update Fail')
)
);
}
echo $msg;
exit;
}
} }
 End of changes. 3 change blocks. 
1 lines changed or deleted 140 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)