fixed call-by-reference warnings

This commit is contained in:
Roland Gruber 2005-02-16 21:00:19 +00:00
parent 1e6c7bc8bd
commit 360e580d79
15 changed files with 60 additions and 54 deletions

View File

@ -197,7 +197,7 @@ class cache {
foreach ($scopes as $scope) {
// Get Scope
If ($scope != '*')
$suffix = call_user_func(array(&$_SESSION['config'], 'get_'.ucfirst($scope).'Suffix'));
$suffix = call_user_func(array($_SESSION['config'], 'get_'.ucfirst($scope).'Suffix'));
else $suffix = '';
// Get Data from ldap
$search = $this->attributes[$scope];
@ -239,7 +239,7 @@ class cache {
if ($allowed_types[$i]!='*') {
// *** fixme, where is get_DomainSuffix
If ($scope != '*')
$suffix = call_user_func(array(&$_SESSION['config'], 'get_'.ucfirst($allowed_types[$i]).'Suffix'));
$suffix = call_user_func(array($_SESSION['config'], 'get_'.ucfirst($allowed_types[$i]).'Suffix'));
else $suffix = '';
if (substr($suffix, $dn)) $singlescope = $allowed_types[$i];
}
@ -250,7 +250,7 @@ class cache {
// Get Scope
foreach ($allowed_types as $scope) {
if ($scope!='*') {
$suffix = call_user_func(array(&$_SESSION['config'], 'get_'.ucfirst($scope).'Suffix'));
$suffix = call_user_func(array($_SESSION['config'], 'get_'.ucfirst($scope).'Suffix'));
if (strpos($dn, $suffix)) $singlescope = $scope;
}
}

View File

@ -640,7 +640,7 @@ class accountContainer {
}
}
}
else $result = call_user_func(array(&$this->module[$this->order[$this->current_page]], 'proccess_'.$this->subpage), &$post);
else $result = call_user_func(array(&$this->module[$this->order[$this->current_page]], 'proccess_'.$this->subpage), $post);
}
if (is_string($result)) $this->subpage = $result;
if (is_int($result)) {
@ -720,7 +720,7 @@ class accountContainer {
if (count($table)!=0) $return[] = array ( 0 => array ( 'kind' => 'table', 'value' => $table ) );
// loop through all suffixes
$rootsuffix = call_user_func(array(&$_SESSION['config'], 'get_' . ucfirst($this->type) . 'Suffix'));
$rootsuffix = call_user_func(array($_SESSION['config'], 'get_' . ucfirst($this->type) . 'Suffix'));
foreach ($_SESSION['ldap']->search_units($rootsuffix) as $suffix) {
if ($this->dn == $suffix) $option_selected = $suffix;
$suffixes[] = $suffix;
@ -766,8 +766,10 @@ class accountContainer {
'value' => _('Back to account list')));
}
}
else $return = call_user_func(array($this->module[$this->order[$this->current_page]], 'display_html_'.$this->subpage), &$post);
$this->parse_html($this->order[$this->current_page], $return);
else $return = call_user_func(array($this->module[$this->order[$this->current_page]], 'display_html_'.$this->subpage), $post);
$y = 5000;
$z = 10000;
$this->parse_html($this->order[$this->current_page], $return, $y, $z);
// Display rest of html-page
echo "</fieldset>\n";
echo "</td></tr></table>\n";
@ -777,7 +779,7 @@ class accountContainer {
return 0;
}
function parse_html($module, $input, $y=5000, $z=10000) {
function parse_html($module, $input, &$y, &$z) {
/* $y and $z are used to change the the taborder.
* Unfortunatly we don't now how many taborders we need
* Every link also help needs a taborder.
@ -826,7 +828,7 @@ class accountContainer {
echo ">\n";
echo "<fieldset>\n";
if ($input[$i][$j]['legend']!='') echo "<legend>" . $input[$i][$j]['legend'] . "</legend>\n";
$this->parse_html($module, $input[$i][$j]['value'], &$y, &$z);
$this->parse_html($module, $input[$i][$j]['value'], $y, $z);
echo "</fieldset>\n";
break;
case 'select':
@ -859,7 +861,7 @@ class accountContainer {
echo "<td";
if ($input[$i][$j]['td']['valign']!='') echo ' valign="' . $input[$i][$j]['td']['valign'] .'"';
echo ">\n";
$this->parse_html($module, $input[$i][$j]['value'], &$y, &$z);
$this->parse_html($module, $input[$i][$j]['value'], $y, $z);
echo "</td>\n";
break;
case 'help':
@ -1247,7 +1249,7 @@ class accountContainer {
// TODO remove this function?
function proccess_profile($post) {
function proccess_profile(&$post) {
$return = array();
$module = array_keys ($this->module);
foreach ($module as $singlemodule) {

View File

@ -143,7 +143,7 @@ class account extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
// Load attributes
$this->attributes['description'][0] = $post['description'];
return 0;
@ -153,7 +153,7 @@ class account extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Description') ),
1 => array ( 'kind' => 'input', 'name' => 'description', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $this->attributes['description'][0] ),
@ -162,7 +162,7 @@ class account extends baseModule {
return $return;
}
function display_html_delete($post) {
function display_html_delete(&$post) {
return 0;
}

View File

@ -138,7 +138,7 @@ class ieee802Device extends baseModule {
*
* @param array $post HTTP-POST values
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
$return = array();
// list current MACs
for ($i = 0; $i < sizeof($this->attributes['macAddress']); $i++) {
@ -163,7 +163,7 @@ class ieee802Device extends baseModule {
*
* @param array $post HTTP-POST values
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
$this->triggered_messages = array();
$this->attributes['macAddress'] = array();
// check old MACs

View File

@ -192,7 +192,7 @@ class inetLocalMailRecipient extends baseModule {
*
* @param array $post HTTP-POST values
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
$return = array();
// mail routing address
$return[] = array(
@ -227,7 +227,7 @@ class inetLocalMailRecipient extends baseModule {
*
* @param array $post HTTP-POST values
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
$this->triggered_messages = array();
$this->attributes['mailRoutingAddress'] = array();
$this->attributes['mailLocalAddress'] = array();

View File

@ -350,7 +350,7 @@ class inetOrgPerson extends baseModule {
return 0;
}
function proccess_attributes($post) {
function proccess_attributes(&$post) {
// Load attributes
$this->attributes['description'][0] = $post['description'];
$this->attributes['sn'][0] = $post['sn'];
@ -397,7 +397,7 @@ class inetOrgPerson extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Description') ),
1 => array ( 'kind' => 'input', 'name' => 'description', 'type' => 'text', 'size' => '30',
'maxlength' => '255', 'value' => $this->attributes['description'][0] ),
@ -457,7 +457,7 @@ class inetOrgPerson extends baseModule {
return $return;
}
function display_html_delete($post) {
function display_html_delete(&$post) {
return 0;
}

View File

@ -162,7 +162,7 @@ class nisMailAlias extends baseModule {
*
* @param array $post HTTP-POST values
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
$return = array();
// alias name
$return[] = array(
@ -192,7 +192,7 @@ class nisMailAlias extends baseModule {
*
* @param array $post HTTP-POST values
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
$this->triggered_messages = array();
$this->attributes['cn'] = array();
$this->attributes['rfc822MailMember'] = array();

View File

@ -585,7 +585,7 @@ class posixAccount extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
$this->attributes['homeDirectory'][0] = $post['homeDirectory'];
$this->attributes['loginShell'][0] = $post['loginShell'];
if (isset($post['gecos'])) $this->attributes['gecos'][0] = $post['gecos'];
@ -787,7 +787,7 @@ class posixAccount extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_group($post) {
function proccess_group(&$post) {
do { // X-Or, only one if() can be true
if (isset($post['addgroups']) && isset($post['addgroups_button'])) { // Add groups to list
// Add new group
@ -810,7 +810,7 @@ class posixAccount extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
$groups = $_SESSION['cache']->findgroups(); // list of all groupnames
$shelllist = getshells(); // list of all valid shells
@ -868,7 +868,7 @@ class posixAccount extends baseModule {
return $return;
}
function display_html_delete($post) {
function display_html_delete(&$post) {
if ($_SESSION[$this->base]->type=='user' && isset($_SESSION['config']->scriptPath)) {
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Delete home directory') ),
1 => array ( 'kind' => 'input', 'name' => 'deletehomedir', 'type' => 'checkbox'),
@ -877,7 +877,7 @@ class posixAccount extends baseModule {
return $return;
}
function display_html_group($post) {
function display_html_group(&$post) {
// load list with all groups
$dn_groups = $_SESSION['cache']->get_cache('gidNumber', 'posixGroup', 'group');
$DNs = array_keys($dn_groups);

View File

@ -121,7 +121,7 @@ class posixGroup extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _("Groupname").'*' ),
1 => array ( 'kind' => 'input', 'name' => 'cn', 'type' => 'text', 'size' => '20', 'maxlength' => '20', 'value' => $this->attributes['cn'][0]),
2 => array ('kind' => 'help', 'value' => 'cn'));
@ -159,13 +159,13 @@ class posixGroup extends baseModule {
}
function display_html_delete($post) {
function display_html_delete(&$post) {
// Get list of primary groupmembers.
return 0;
}
function display_html_user($post) {
function display_html_user(&$post) {
// load list with all groups
$dn_users = $_SESSION['cache']->get_cache('uid', 'posixAccount', 'user');
if (is_array($dn_users)) {
@ -441,7 +441,7 @@ class posixGroup extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
$this->attributes['description'][0] = $post['description'];
if (($post['userPassword_lock'] && $post['userPassword_invalid']) || ($post['userPassword_nopassword'] && $post['userPassword_invalid'])) {
@ -607,7 +607,7 @@ class posixGroup extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_user($post) {
function proccess_user(&$post) {
do { // X-Or, only one if() can be true
if (isset($post['addusers']) && isset($post['addusers_button'])) { // Add groups to list
// Add new user

View File

@ -248,7 +248,7 @@ class quota extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
// Write all general values into $account_new
$i=0;
// loop for every mointpoint with quotas
@ -286,7 +286,7 @@ class quota extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
$return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Mountpoint') ),
1 => array ( 'kind' => 'text', 'text' => _('Used blocks') ),
@ -325,7 +325,7 @@ class quota extends baseModule {
return $return;
}
function display_html_delete($post) {
function display_html_delete(&$post) {
return 0;
}

View File

@ -381,7 +381,11 @@ class sambaAccount extends baseModule {
return $return;
}
// Constructor
/**
* Initializes the module after it became part of an accountContainer
*
* @param string $base the name of the accountContainer object ($_SESSION[$base])
*/
function init($base) {
// call parent init
parent::init($base);
@ -525,7 +529,7 @@ class sambaAccount extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
$this->attributes['domain'][0] = $post['domain'];
// Start character
$flag = "[";
@ -658,7 +662,7 @@ class sambaAccount extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_userWorkstations($post) {
function proccess_userWorkstations(&$post) {
// Load attributes
if ($_SESSION[$this->base]->type=='user') {
do { // X-Or, only one if() can be true
@ -709,7 +713,7 @@ class sambaAccount extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
if ($_SESSION[$this->base]->type=='user') {
$canchangedate = getdate($this->attributes['pwdCanChange'][0]);
$mustchangedate = getdate($this->attributes['pwdMustChange'][0]);
@ -825,7 +829,7 @@ class sambaAccount extends baseModule {
return $return;
}
function display_html_delete($post) {
function display_html_delete(&$post) {
return 0;
}
@ -833,7 +837,7 @@ class sambaAccount extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_userWorkstations($post) {
function display_html_userWorkstations(&$post) {
if ($_SESSION[$this->base]->type=='user') {
// Get list of all hosts.
$result = $_SESSION['cache']->get_cache('uid', 'sambaAccount', 'host');

View File

@ -142,7 +142,7 @@ class sambaGroupMapping extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
// Get Domain SID from name
$sambaDomains = search_domains($_SESSION['config']->get_domainSuffix());
// Get Domain-SID from group SID
@ -191,7 +191,7 @@ class sambaGroupMapping extends baseModule {
return $return;
}
function display_html_delete($post) {
function display_html_delete(&$post) {
return 0;
}
@ -390,7 +390,7 @@ class sambaGroupMapping extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
// Save attributes
$this->attributes['displayName'][0] = $post['displayName'];
$this->attributes['sambaGroupType'][0] = $this->sambaGroupTypes[$post['sambaGroupType']];

View File

@ -498,7 +498,7 @@ class sambaSamAccount extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
// Save attributes
$this->attributes['sambaDomainName'][0] = $post['sambaDomainName'];
// Get Domain SID from name
@ -639,7 +639,7 @@ class sambaSamAccount extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_sambaUserWorkstations($post) {
function proccess_sambaUserWorkstations(&$post) {
// Load attributes
if ($_SESSION[$this->base]->type=='user') {
do { // X-Or, only one if() can be true
@ -690,7 +690,7 @@ class sambaSamAccount extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
// Get Domain SID from name
$sambaDomains = search_domains($_SESSION['config']->get_domainSuffix());
for ($i=0; $i<count($sambaDomains); $i++ ) {
@ -815,7 +815,7 @@ class sambaSamAccount extends baseModule {
return $return;
}
function display_html_delete($post) {
function display_html_delete(&$post) {
return 0;
}
@ -823,7 +823,7 @@ class sambaSamAccount extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_sambaUserWorkstations($post) {
function display_html_sambaUserWorkstations(&$post) {
if ($_SESSION[$this->base]->type=='user') {
// Get list of all hosts.
$result = $_SESSION['cache']->get_cache('uid', 'sambaSamAccount', 'host');

View File

@ -268,7 +268,7 @@ class shadowAccount extends baseModule {
/* Write variables into object and do some regexp checks
*/
function proccess_attributes($post) {
function proccess_attributes(&$post) {
// Load attributes
$this->attributes['shadowMin'][0] = $post['shadowMin'];
$this->attributes['shadowMax'][0] = $post['shadowMax'];
@ -294,7 +294,7 @@ class shadowAccount extends baseModule {
* to show a page with all attributes.
* It will output a complete html-table
*/
function display_html_attributes($post) {
function display_html_attributes(&$post) {
// Use dd-mm-yyyy format of date because it's easier to read for humans
$date = getdate ($this->attributes['shadowExpire'][0]*3600*24);
@ -326,7 +326,7 @@ class shadowAccount extends baseModule {
return $return;
}
function display_html_delete($post) {
function display_html_delete(&$post) {
return 0;
}

View File

@ -49,7 +49,7 @@ class xmlParser {
*/
function xmlParser() {
$this->xmlParser = xml_parser_create();
xml_set_object($this->xmlParser,&$this);
xml_set_object($this->xmlParser,$this);
xml_parser_set_option($this->xmlParser, XML_OPTION_CASE_FOLDING, 1);
xml_parser_set_option($this->xmlParser, XML_OPTION_SKIP_WHITE, 1);
}