}
if (func_num_args() > 2) {
- $args = func_get_args();
// Handle args in order: year month day hour min sec tz
$this->_initializeFromArgs(func_get_args());
return;
{
parent::next($pointer);
- $fullDay = 60 * 60 * 24;
-
if (!$this->currentSpan) {
$nowSeconds = $this->now->hour * 3600 + $this->now->min * 60 + $this->now->sec;
if ($nowSeconds < $this->range[0]) {
public $type;
public $ambiguous;
- public function __construct($time, $options = array())
+ public function __construct($time)
{
$t = str_replace(':', '', $time);
} catch (Exception $e) {
/* We have a failure. What kind? We may be able to
* reconnect and try again. */
- $error_code = $e->getCode();
- $error_name = $this->errorName($error_code);
-
- if ($this->errorName($error_code) != 'LDAP_OPERATIONS_ERROR' ||
+ if ($this->errorName($e->getCode()) != 'LDAP_OPERATIONS_ERROR' ||
!$this->_config['auto_reconnect']) {
/* Errors other than the above catched are just passed
* back to the user so he may react upon them. */
/* Make dn relative to parent. */
$base = Horde_Ldap_Util::explodeDN($dn, array('casefold' => 'none', 'reverse' => false, 'onlyvalues' => false));
-
$entry_rdn = array_shift($base);
- if (is_array($entry_rdn)) {
- /* Maybe the dn consist of a multivalued RDN. We must
- * build the dn in this case because the $entry_rdn is an
- * array. */
- $filter_dn = Horde_Ldap_Util::canonicalDN($entry_rdn);
- }
$base = Horde_Ldap_Util::canonicalDN($base);
$result = @ldap_list($this->_link, $base, $entry_rdn, array(), 1, 1);
public function getValues()
{
$attrs = array();
- foreach ($this->_attributes as $attr => $value) {
+ foreach (array_keys($this->_attributes) as $attr) {
$attrs[$attr] = $this->getValue($attr);
}
return $attrs;
/* New entry. */
if ($this->_new) {
- $msg = $ldap->add($this);
+ $ldap->add($this);
$this->_new = false;
$this->_changes['add'] = array();
$this->_changes['delete'] = array();
// operator.
$subfilters_o = array();
foreach ($subfilters as $s_s) {
- $o = self::parse($s_s);
array_push($subfilters_o, self::parse($s_s));
}
if (count($subfilters_o) == 1) {
} elseif ($entry->willBeMoved()) {
$this->_writeLine('changetype: modrdn');
$olddn = Horde_Ldap_Util::explodeDN($entry->currentDN(), array('casefold' => 'none'));
- $oldrdn = array_shift($olddn);
+ array_shift($olddn);
$oldparent = implode(',', $olddn);
$newdn = Horde_Ldap_Util::explodeDN($entry->dn(), array('casefold' => 'none'));
$rdn = array_shift($newdn);
}
// Free variables.
- foreach (get_object_vars($this) as $name => $value) {
+ foreach (array_keys(get_object_vars($this)) as $name) {
unset($this->$name);
}
}
{
$return = array();
$sorted = $this->sortedAsArray($attrs, $order);
- foreach ($sorted as $key => $row) {
+ foreach ($sorted as $row) {
$entry = $this->_ldap->getEntry($row['dn'], $this->searchedAttributes());
array_push($return, $entry);
}
if ($options['onlyvalues']) {
preg_match('/(.+?)(?<!\\\\)=(.+)/', $subrdn_v, $matches);
- $rdn_ocl = $matches[1];
$rdn_val = $matches[2];
$unescaped = self::unescapeDNValue($rdn_val);
$rdns[$subrdn_k] = $unescaped[0];
if ($options['onlyvalues']) {
preg_match('/(.+?)(?<!\\\\)=(.+)/', $value, $matches);
- $dn_ocl = $matches[1];
$dn_val = $matches[2];
$unescaped = self::unescapeDNValue($dn_val);
$dn_array[$key] = $unescaped[0];