PHP 5.3 compatibility
This commit is contained in:
parent
2bd8c5f569
commit
f1e3cb7ad0
|
@ -128,7 +128,7 @@ function lamdaemonSSH($commands, $server) {
|
|||
return $return;
|
||||
}
|
||||
usleep(100);
|
||||
$read = split("\n", trim(fread($shell, 100000)));
|
||||
$read = explode("\n", trim(fread($shell, 100000)));
|
||||
if ((sizeof($read) == 1) && (!isset($read[0]) || ($read[0] == ""))) continue;
|
||||
for ($i = 0; $i < sizeof($read); $i++) {
|
||||
$return[] = $read[$i];
|
||||
|
|
|
@ -1482,7 +1482,7 @@ class accountContainer {
|
|||
$this->dn = substr($dn, strpos($dn, ',')+1);
|
||||
$this->dn_orig = $dn;
|
||||
// extract RDN
|
||||
$this->rdn = split("=", substr($dn, 0, strpos($dn, ',')));
|
||||
$this->rdn = explode("=", substr($dn, 0, strpos($dn, ',')));
|
||||
$this->rdn = $this->rdn[0];
|
||||
$attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
|
||||
// remove 'count' entries and numerical entries
|
||||
|
|
|
@ -40,7 +40,7 @@ $Id$
|
|||
**/
|
||||
if (!function_exists('check_ip')) {
|
||||
function check_ip($ip,$subnet=false) {
|
||||
$part = split("[.]", $ip);
|
||||
$part = explode(".", $ip);
|
||||
// Wenn... Keine 4 Segmente gefunden wurde
|
||||
if (count($part) != 4) {
|
||||
return false;
|
||||
|
|
|
@ -312,7 +312,7 @@ class kolabUser extends baseModule {
|
|||
// default invitation policy
|
||||
$defaultInvPol = $this->invitationPolicies['ACT_MANUAL'];
|
||||
for ($i = 0; $i < sizeof($this->attributes['kolabInvitationPolicy']); $i++) {
|
||||
$parts = split(":", $this->attributes['kolabInvitationPolicy'][$i]);
|
||||
$parts = explode(":", $this->attributes['kolabInvitationPolicy'][$i]);
|
||||
if (sizeof($parts) == 1) {
|
||||
$defaultInvPol = $this->invitationPolicies[$this->attributes['kolabInvitationPolicy'][$i]];
|
||||
unset($this->attributes['kolabInvitationPolicy'][$i]);
|
||||
|
@ -326,7 +326,7 @@ class kolabUser extends baseModule {
|
|||
array('kind' => 'help', 'value' => 'invPol'));
|
||||
// other invitation policies
|
||||
for ($i = 0; $i < sizeof($this->attributes['kolabInvitationPolicy']); $i++) {
|
||||
$parts = split(":", $this->attributes['kolabInvitationPolicy'][$i]);
|
||||
$parts = explode(":", $this->attributes['kolabInvitationPolicy'][$i]);
|
||||
if (sizeof($parts) == 2) {
|
||||
$returnPol[] = array(
|
||||
array('kind' => 'input', 'name' => 'invPol1' . $i, 'type' => 'text', 'value' => $parts[0]),
|
||||
|
@ -647,7 +647,7 @@ class kolabUser extends baseModule {
|
|||
$policies = array_keys($this->invitationPolicies);
|
||||
$defaultFound = false;
|
||||
for ($p = 0; $p < sizeof($pols); $p++) {
|
||||
$parts = split(":", $pols[$p]);
|
||||
$parts = explode(":", $pols[$p]);
|
||||
// default policy
|
||||
if (sizeof($parts) == 1) {
|
||||
if (!$defaultFound && get_preg($parts[0], 'email')) {
|
||||
|
@ -781,7 +781,7 @@ class kolabUser extends baseModule {
|
|||
}
|
||||
$return['kolabUser_invPol'][0] = '<block><key>' . _('Invitation policy') . '</key><tr><td align=\"L\">' . _('Anyone') . ": " . $this->invitationPolicies[$default] . '</td></tr></block>';
|
||||
for ($i = 0; $i < sizeof($this->attributes['kolabInvitationPolicy']); $i++) {
|
||||
$parts = split(':', $this->attributes['kolabInvitationPolicy'][$i]);
|
||||
$parts = explode(':', $this->attributes['kolabInvitationPolicy'][$i]);
|
||||
if (sizeof($parts) == 2) {
|
||||
$return['kolabUser_invPol'][] = '<block><tr><td align=\"L\">' . $parts[0] . ": " . $this->invitationPolicies[$parts[1]] . '</td></tr></block>';
|
||||
}
|
||||
|
@ -872,7 +872,7 @@ class kolabUser extends baseModule {
|
|||
// default invitation policy
|
||||
$defaultInvPol = $this->invitationPolicies['ACT_MANUAL'];
|
||||
for ($i = 0; $i < sizeof($attributes['kolabInvitationPolicy']); $i++) {
|
||||
$parts = split(":", $attributes['kolabInvitationPolicy'][$i]);
|
||||
$parts = explode(":", $attributes['kolabInvitationPolicy'][$i]);
|
||||
if (sizeof($parts) == 1) {
|
||||
$defaultInvPol = $this->invitationPolicies[$attributes['kolabInvitationPolicy'][$i]];
|
||||
unset($attributes['kolabInvitationPolicy'][$i]);
|
||||
|
@ -886,7 +886,7 @@ class kolabUser extends baseModule {
|
|||
array('kind' => 'text', 'text' => ''));
|
||||
// other invitation policies
|
||||
for ($i = 0; $i < sizeof($attributes['kolabInvitationPolicy']); $i++) {
|
||||
$parts = split(":", $attributes['kolabInvitationPolicy'][$i]);
|
||||
$parts = explode(":", $attributes['kolabInvitationPolicy'][$i]);
|
||||
if (sizeof($parts) == 2) {
|
||||
$returnPol[] = array(
|
||||
array('kind' => 'input', 'name' => 'invPol1' . $i, 'type' => 'text', 'value' => $parts[0]),
|
||||
|
|
|
@ -449,10 +449,10 @@ class quota extends baseModule {
|
|||
|
||||
// Get quotas
|
||||
$quotas = lamdaemon(array("+ quota get " . $this->get_scope()), $server);
|
||||
$dirs = split(":", $quotas[0]);
|
||||
$dirs = explode(":", $quotas[0]);
|
||||
array_pop($dirs); // remove empty element at the end
|
||||
for ($i = 0; $i < sizeof($dirs); $i++) {
|
||||
$dirs[$i] = split(",", $dirs[$i]);
|
||||
$dirs[$i] = explode(",", $dirs[$i]);
|
||||
$dirs[$i] = $dirs[$i][0];
|
||||
}
|
||||
if (sizeof($dirs) < 1) continue; // stop if no quota directories were found
|
||||
|
@ -503,10 +503,10 @@ class quota extends baseModule {
|
|||
$id = $this->replaceSpecialChars($server);
|
||||
// Get quotas
|
||||
$quotas = lamdaemon(array("+ quota get " . $this->get_scope()), $server);
|
||||
$dirs = split(":", $quotas[0]);
|
||||
$dirs = explode(":", $quotas[0]);
|
||||
array_pop($dirs); // remove empty element at the end
|
||||
for ($i = 0; $i < sizeof($dirs); $i++) {
|
||||
$dirs[$i] = split(",", $dirs[$i]);
|
||||
$dirs[$i] = explode(",", $dirs[$i]);
|
||||
$dirs[$i] = $dirs[$i][0];
|
||||
}
|
||||
for ($i = 0; $i < sizeof($dirs); $i++) {
|
||||
|
@ -615,10 +615,10 @@ class quota extends baseModule {
|
|||
$server = $temp[0];
|
||||
// Get quotas
|
||||
$quotas = lamdaemon(array("+ quota get " . $this->get_scope()), $server);
|
||||
$dirs = split(":", $quotas[0]);
|
||||
$dirs = explode(":", $quotas[0]);
|
||||
array_pop($dirs); // remove empty element at the end
|
||||
for ($i = 0; $i < sizeof($dirs); $i++) {
|
||||
$dirs[$i] = split(",", $dirs[$i]);
|
||||
$dirs[$i] = explode(",", $dirs[$i]);
|
||||
$dirs[$i] = $dirs[$i][0];
|
||||
}
|
||||
for ($i = 0; $i < sizeof($dirs); $i++) {
|
||||
|
@ -729,7 +729,7 @@ class quota extends baseModule {
|
|||
$mountPoints = array_keys($temp['accounts'][$name]);
|
||||
// set quota
|
||||
for ($m = 0; $m < sizeof($mountPoints); $m++) {
|
||||
$mpParts = split(":", $mountPoints[$m]);
|
||||
$mpParts = explode(":", $mountPoints[$m]);
|
||||
$server = $mpParts[0];
|
||||
$dir = $mpParts[1];
|
||||
$quotaString = $name . " quota set " . $this->get_scope() . " " . $dir . ',' .
|
||||
|
|
|
@ -75,7 +75,7 @@ function loadAccountProfile($profile, $scope) {
|
|||
if (($line == "\n")||($line[0] == "#")) continue; // ignore comments
|
||||
// search keywords
|
||||
$parts = array();
|
||||
$parts = split(": ", $line);
|
||||
$parts = explode(": ", $line);
|
||||
if (sizeof($parts) != 2) continue; // ignore malformed settings
|
||||
else {
|
||||
$option = $parts[0];
|
||||
|
|
|
@ -155,7 +155,7 @@ function lamTestLamdaemon($command, $stopTest, $handle, $testText) {
|
|||
break;
|
||||
}
|
||||
usleep(100);
|
||||
$read = split("\n", trim(fread($shell, 100000)));
|
||||
$read = explode("\n", trim(fread($shell, 100000)));
|
||||
if ((sizeof($read) == 1) && (!isset($read[0]) || ($read[0] == ""))) continue;
|
||||
for ($i = 0; $i < sizeof($read); $i++) {
|
||||
$return[] = $read[$i];
|
||||
|
@ -181,7 +181,7 @@ function lamTestLamdaemon($command, $stopTest, $handle, $testText) {
|
|||
echo "<td>" . $failImage . " </td>\n";
|
||||
echo "<td>\n";
|
||||
for ($i = 0; $i < sizeof($return); $i++) {
|
||||
call_user_func_array('StatusMessage', split(",", $return[$i]));
|
||||
call_user_func_array('StatusMessage', explode(",", $return[$i]));
|
||||
}
|
||||
echo "</td>\n";
|
||||
$stopTest = true;
|
||||
|
|
Loading…
Reference in New Issue