~ubuntu-branches/debian/stretch/phpldapadmin/stretch

« back to all changes in this revision

Viewing changes to lib/Attribute.php

  • Committer: Package Import Robot
  • Author(s): Fabio Tranchitella, Marcus Osdoba, Fabio Tranchitella
  • Date: 2012-02-08 08:52:18 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20120208085218-9vopuqvdwo6ks4xs
Tags: 1.2.2-1
[ Marcus Osdoba ]
* Non-maintainer upload.
* New upstream release (Closes: #605061,#499862,#505578,#517802,#642445)
* Not reproducible in this version (Closes: #502412,#505575,#521033,#527070)
* SF Bug #3477910 - XSS vulnerability in query
* Remove dependency to unknown package libapache-mod-php5
* Fix lintian warnings in templates.
* Remove apt-dependancy to apache2 (Closes: #622657)
* Use | instead of # for sed used in config/postinst (Closes: #616305)
* Add browser hint in package description (Closes: #527070)
* Fix pending l10n issues. Debconf translations:
  - Danish (Joe Hansen).  Closes: #638680
  - Polish (Michał Kułach).  Closes: #657458
* Bump standards to 3.9.2
* Use quilt as source format

[ Fabio Tranchitella ]
* Uploaded work by Marcus Osdoba.

Show diffs side-by-side

added added

removed removed

Lines of Context:
477
477
                $this->readonly = true;
478
478
        }
479
479
 
 
480
        public function isMultiple() {
 
481
                return false;
 
482
        }
 
483
 
480
484
        public function isVisible() {
481
485
                if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
482
486
                        debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
774
778
 
775
779
                                        case 'value':
776
780
                                                if (is_array($value))
777
 
                                                        $this->values = $value;
 
781
                                                        foreach ($value as $y) {
 
782
                                                                if (! $this->haveMoreValues()) {
 
783
                                                                        system_message(array(
 
784
                                                                        'title'=>_('Automatically removed attribute values from template'),
 
785
                                                                                'body'=>sprintf('%s <small>[%s]</small>',_('Template defines more values than can be accepted by attribute.'),$this->getName(true)),
 
786
                                                                                'type'=>'warn'));
 
787
 
 
788
                                                                        $this->clearValue();
 
789
 
 
790
                                                                        break;
 
791
 
 
792
                                                                } else
 
793
                                                                        $this->addValue($y);
 
794
                                                        }
778
795
 
779
796
                                                else
780
797
                                                        # Check to see if the value is auto generated.
787
804
                                                                        $this->hint = _('Automatically determined');
788
805
 
789
806
                                                        } else
790
 
                                                                $this->values = array($value);
 
807
                                                                $this->addValue($value);
791
808
 
792
809
                                                break;
793
810
 
834
851
                if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
835
852
                        debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
836
853
 
837
 
                $return = array();
838
 
 
839
 
                foreach ($this->getOldValues() as $value)
840
 
                        if (! in_array($value,$this->getValues()))
841
 
                                array_push($return,$value);
842
 
 
843
 
                return $return;
 
854
                return array_diff($this->getOldValues(),$this->getValues());
844
855
        }
845
856
 
846
857
        /**
850
861
                if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
851
862
                        debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
852
863
 
853
 
                $return = array();
854
 
 
855
 
                foreach ($this->getValues() as $value)
856
 
                        if (! in_array($value,$this->getOldValues()))
857
 
                                array_push($return,$value);
858
 
 
859
 
                return $return;
 
864
                return array_diff($this->getValues(),$this->getOldValues());
860
865
        }
861
866
 
862
867
        /**