index eaa1be78c7a4ce192232b331724de9229fa0e049..bfe31d074dd4ecdd28049ffe6b6e12e94f3c466b 100644 (file)
if (tests::is_id($_POST['new_limit']) &&
isset($_POST['action']) && $_POST['action']=="newlimit"){
- session::global_set('size_limit', validate($_POST['new_limit']));
+ session::global_set('size_limit', get_post('new_limit'));
session::set('size_ignore', FALSE);
}
@@ -2896,16 +2896,30 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
* */
function get_post($name)
{
- if(!isset($_POST[$name])){
- trigger_error("Requested POST value (".$name.") does not exists, you should add a check to prevent this message.");
- return(FALSE);
- }
+ if(!isset($_POST[$name])){
+ trigger_error("Requested POST value (".$name.") does not exists, you should add a check to prevent this message.");
+ return(FALSE);
+ }
- if(get_magic_quotes_gpc()){
- return(stripcslashes(validate($_POST[$name])));
- }else{
- return(validate($_POST[$name]));
- }
+ // Handle Posted Arrays
+ $tmp = array();
+ if(is_array($_POST[$name]) && !is_string($_POST[$name])){
+ foreach($_POST[$name] as $key => $val){
+ if(get_magic_quotes_gpc()){
+ $val = stripcslashes($val);
+ }
+ $tmp[$key] = $val;
+ }
+ return($tmp);
+ }else{
+
+ if(get_magic_quotes_gpc()){
+ $val = stripcslashes($_POST[$name]);
+ }else{
+ $val = $_POST[$name];
+ }
+ }
+ return($val);
}
function set_post($value)
{
+ // Take care of array, recursivly convert each array entry.
+ if(is_array($value)){
+ foreach($value as $key => $val){
+ $value[$key] = set_post($val);
+ }
+ return($value);
+ }
+
+ // Do not touch boolean values, we may break them.
+ if($value === TRUE || $value === FALSE ) return($value);
+
+ // Return a fixed string which can then be used in HTML fields without
+ // breaking the layout or the values. This allows to use '"<> in input fields.
return(htmlentities($value, ENT_QUOTES, 'utf-8'));
}
if($test instanceOf passwordMethod){
+ stats::log('global', 'global', array('users'), $action = 'change_password', $amount = 1, 0, $test->get_hash());
+
$deactivated = $test->is_locked($config,$dn);
/* Feed password backends with information */
// Not for groups
if ($mode == 0){
- // Create SMB Password
- $attrs= generate_smb_nt_hash($password);
- if ($shadow != 0){
- $attrs['shadowLastChange']= $shadow;
- }
+ $tmp = $config->get_cfg_value('core','sambaHashHook');
+ if(!empty($tmp)){
+
+ // Create SMB Password
+ $attrs= generate_smb_nt_hash($password);
+
+ if ($shadow != 0){
+ $attrs['shadowLastChange']= $shadow;
+ }
+ }
}
$attrs['userPassword']= array();