@@ -69,6 +69,9 @@ |
||
69 | 69 | return $data[0]['hint']; |
70 | 70 | } |
71 | 71 | |
72 | + /** |
|
73 | + * @return string |
|
74 | + */ |
|
72 | 75 | private function get_answer() |
73 | 76 | { |
74 | 77 | $dataset = DataSetFactory::get_data_set('profiles'); |
@@ -36,13 +36,13 @@ discard block |
||
36 | 36 | { |
37 | 37 | $dataset = DataSetFactory::getDataSetByName('profiles'); |
38 | 38 | $datatable = $dataset['captcha']; |
39 | - return $datatable->create(array('question'=>$question,'hint'=>$hint,'answer'=>$answer)); |
|
39 | + return $datatable->create(array('question'=>$question, 'hint'=>$hint, 'answer'=>$answer)); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function __construct() |
43 | 43 | { |
44 | 44 | $this->validIDs = FlipsideCAPTCHA::get_valid_captcha_ids(); |
45 | - $this->random_id = mt_rand(0, count($this->validIDs)-1); |
|
45 | + $this->random_id = mt_rand(0, count($this->validIDs) - 1); |
|
46 | 46 | $this->random_id = $this->validIDs[$this->random_id]; |
47 | 47 | } |
48 | 48 | |
@@ -84,22 +84,22 @@ discard block |
||
84 | 84 | |
85 | 85 | public function is_answer_right($answer) |
86 | 86 | { |
87 | - return strcasecmp($this->get_answer(),$answer) == 0; |
|
87 | + return strcasecmp($this->get_answer(), $answer) == 0; |
|
88 | 88 | } |
89 | 89 | |
90 | - public function draw_captcha($explination=true, $return=false, $ownForm=false) |
|
90 | + public function draw_captcha($explination = true, $return = false, $ownForm = false) |
|
91 | 91 | { |
92 | 92 | $string = ''; |
93 | 93 | |
94 | 94 | if($ownForm) |
95 | 95 | { |
96 | - $string.= '<form id="flipcaptcha" name="flipcaptcha">'; |
|
96 | + $string .= '<form id="flipcaptcha" name="flipcaptcha">'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | $string .= '<label for="captcha" class="col-sm-2 control-label">'.$this->get_question().'</label><div class="col-sm-10"><input class="form-control" type="text" id="captcha" name="captcha" placeholder="'.$this->get_hint().'" required/></div>'; |
100 | 100 | if($ownForm) |
101 | 101 | { |
102 | - $string.='</form>'; |
|
102 | + $string .= '</form>'; |
|
103 | 103 | } |
104 | 104 | if($explination) |
105 | 105 | { |
@@ -37,7 +37,7 @@ |
||
37 | 37 | /** |
38 | 38 | * Serialize the object into a format consumable by json_encode |
39 | 39 | * |
40 | - * @return mixed The object in a more serialized format |
|
40 | + * @return SerializableObject The object in a more serialized format |
|
41 | 41 | */ |
42 | 42 | public function jsonSerialize() |
43 | 43 | { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | $xml->startElement($key); |
88 | 88 | $this->object2XML($xml, $value); |
89 | - $xml->endElement(); |
|
89 | + $xml->endElement(); |
|
90 | 90 | } |
91 | 91 | else |
92 | 92 | { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | foreach($data as $key => $value) |
116 | 116 | { |
117 | - if(is_string($value)) |
|
117 | + if(is_string($value)) |
|
118 | 118 | { |
119 | 119 | $xml->writeElement($keyParent, $value); |
120 | 120 | continue; |
@@ -16,14 +16,14 @@ |
||
16 | 16 | * |
17 | 17 | * This class can be serialized to various formats |
18 | 18 | */ |
19 | -class SerializableObject implements ArrayAccess,JsonSerializable |
|
19 | +class SerializableObject implements ArrayAccess, JsonSerializable |
|
20 | 20 | { |
21 | 21 | /** |
22 | 22 | * Create the object from an array |
23 | 23 | * |
24 | 24 | * @param array $array The array of object properties |
25 | 25 | */ |
26 | - public function __construct($array=false) |
|
26 | + public function __construct($array = false) |
|
27 | 27 | { |
28 | 28 | if($array !== false && is_array($array)) |
29 | 29 | { |
@@ -115,7 +115,7 @@ |
||
115 | 115 | foreach($data as $key => $value) |
116 | 116 | { |
117 | 117 | if(is_string($value)) |
118 | - { |
|
118 | + { |
|
119 | 119 | $xml->writeElement($keyParent, $value); |
120 | 120 | continue; |
121 | 121 | } |
@@ -12,11 +12,17 @@ |
||
12 | 12 | if($string !== false) $this->process_filter_string($string); |
13 | 13 | } |
14 | 14 | |
15 | + /** |
|
16 | + * @param string $needle |
|
17 | + */ |
|
15 | 18 | static function str_startswith($haystack, $needle) |
16 | 19 | { |
17 | 20 | return substr($haystack, 0, strlen($needle)) === $needle; |
18 | 21 | } |
19 | 22 | |
23 | + /** |
|
24 | + * @param boolean $string |
|
25 | + */ |
|
20 | 26 | protected function process_filter_string($string) |
21 | 27 | { |
22 | 28 | if(self::str_startswith($string, 'substringof') || self::str_startswith($string, 'contains') || |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | public $var2; |
8 | 8 | public $op; |
9 | 9 | |
10 | - function __construct($string=false) |
|
10 | + function __construct($string = false) |
|
11 | 11 | { |
12 | 12 | if($string !== false) $this->process_filter_string($string); |
13 | 13 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | case 'substringof': |
65 | 65 | case 'contains': |
66 | - $str = $this->var1.' LIKE \'%'.trim($this->var2,"'").'%\''; |
|
66 | + $str = $this->var1.' LIKE \'%'.trim($this->var2, "'").'%\''; |
|
67 | 67 | break; |
68 | 68 | default: |
69 | 69 | $str = $this->var1.$this->op.$this->var2; |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | { |
80 | 80 | case 'substringof': |
81 | 81 | case 'contains': |
82 | - $str.=$this->var1.$this->op.'*'.trim($this->var2,"'").'*'; |
|
82 | + $str .= $this->var1.$this->op.'*'.trim($this->var2, "'").'*'; |
|
83 | 83 | break; |
84 | 84 | case '!=': |
85 | - $str.='!('.$this->var1.'='.$this->var2.')'; |
|
85 | + $str .= '!('.$this->var1.'='.$this->var2.')'; |
|
86 | 86 | break; |
87 | 87 | default: |
88 | - $str.=$this->var1.$this->op.$this->var2; |
|
88 | + $str .= $this->var1.$this->op.$this->var2; |
|
89 | 89 | break; |
90 | 90 | } |
91 | 91 | return $str.')'; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $case = false; |
120 | 120 | if(self::str_startswith($this->var1, 'tolower')) |
121 | 121 | { |
122 | - $field = substr($this->var1, strpos($this->var1, '(')+1); |
|
122 | + $field = substr($this->var1, strpos($this->var1, '(') + 1); |
|
123 | 123 | $field = substr($field, 0, strpos($field, ')')); |
124 | 124 | $case = true; |
125 | 125 | } |
@@ -9,7 +9,10 @@ |
||
9 | 9 | |
10 | 10 | function __construct($string=false) |
11 | 11 | { |
12 | - if($string !== false) $this->process_filter_string($string); |
|
12 | + if($string !== false) |
|
13 | + { |
|
14 | + $this->process_filter_string($string); |
|
15 | + } |
|
13 | 16 | } |
14 | 17 | |
15 | 18 | static function str_startswith($haystack, $needle) |
@@ -17,6 +17,9 @@ |
||
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | + /** |
|
21 | + * @param string $sql |
|
22 | + */ |
|
20 | 23 | function _get_row_count_for_query($sql) |
21 | 24 | { |
22 | 25 | $stmt = $this->pdo->query($sql); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | throw new \Exception('No such table '.$name); |
107 | 107 | } |
108 | 108 | |
109 | - function read($tablename, $where=false, $select='*', $count=false, $skip=false, $sort=false) |
|
109 | + function read($tablename, $where = false, $select = '*', $count = false, $skip = false, $sort = false) |
|
110 | 110 | { |
111 | 111 | if($select === false) |
112 | 112 | { |
@@ -115,28 +115,28 @@ discard block |
||
115 | 115 | $sql = "SELECT $select FROM $tablename"; |
116 | 116 | if($where !== false) |
117 | 117 | { |
118 | - $sql.=' WHERE '.$where; |
|
118 | + $sql .= ' WHERE '.$where; |
|
119 | 119 | } |
120 | 120 | if($count !== false) |
121 | 121 | { |
122 | 122 | if($skip === false) |
123 | 123 | { |
124 | - $sql.=' LIMIT '.(int)$count; |
|
124 | + $sql .= ' LIMIT '.(int)$count; |
|
125 | 125 | } |
126 | 126 | else |
127 | 127 | { |
128 | - $sql.=" LIMIT $skip, $count"; |
|
128 | + $sql .= " LIMIT $skip, $count"; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | if($sort !== false) |
132 | 132 | { |
133 | - $sql.=' ORDER BY '; |
|
133 | + $sql .= ' ORDER BY '; |
|
134 | 134 | $tmp = array(); |
135 | 135 | foreach($sort as $sort_col=>$dir) |
136 | 136 | { |
137 | - array_push($tmp, $sort_col.' '.($dir === 1?'ASC':'DESC')); |
|
137 | + array_push($tmp, $sort_col.' '.($dir === 1 ? 'ASC' : 'DESC')); |
|
138 | 138 | } |
139 | - $sql.=implode($tmp,','); |
|
139 | + $sql .= implode($tmp, ','); |
|
140 | 140 | } |
141 | 141 | $stmt = $this->pdo->query($sql, \PDO::FETCH_ASSOC); |
142 | 142 | if($stmt === false) |
@@ -6,6 +6,9 @@ |
||
6 | 6 | protected $dataset; |
7 | 7 | protected $tablename; |
8 | 8 | |
9 | + /** |
|
10 | + * @param SQLDataSet $dataset |
|
11 | + */ |
|
9 | 12 | function __construct($dataset, $tablename) |
10 | 13 | { |
11 | 14 | $this->dataset = $dataset; |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | $ret = $this->dataset->read($this->tablename, $where, 'COUNT(*)'); |
66 | 66 | if($ret === false || !isset($ret[0]) || !isset($ret[0]['COUNT(*)'])) |
67 | 67 | { |
68 | - return false; |
|
68 | + return false; |
|
69 | 69 | } |
70 | 70 | else |
71 | 71 | { |
72 | - return $ret[0]['COUNT(*)']; |
|
72 | + return $ret[0]['COUNT(*)']; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | |
94 | 94 | function update($filter, $data) |
95 | 95 | { |
96 | - $where = $filter->to_sql_string(); |
|
97 | - return $this->dataset->update($this->tablename, $where, $data); |
|
96 | + $where = $filter->to_sql_string(); |
|
97 | + return $this->dataset->update($this->tablename, $where, $data); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | function create($data) |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | - function count($filter=false) |
|
54 | + function count($filter = false) |
|
55 | 55 | { |
56 | 56 | if($this->data !== null) |
57 | 57 | { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - function search($filter=false, $select=false, $count=false, $skip=false, $sort=false, $params=false) |
|
76 | + function search($filter = false, $select = false, $count = false, $skip = false, $sort = false, $params = false) |
|
77 | 77 | { |
78 | 78 | if($this->data !== null) |
79 | 79 | { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * Who is this email going to |
74 | 74 | * |
75 | - * @return array The recipients of the email |
|
75 | + * @return string The recipients of the email |
|
76 | 76 | */ |
77 | 77 | public function getToAddresses() |
78 | 78 | { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | /** |
83 | 83 | * Who is this email going to (CC) |
84 | 84 | * |
85 | - * @return array The recipients of the email |
|
85 | + * @return string The recipients of the email |
|
86 | 86 | */ |
87 | 87 | public function getCCAddresses() |
88 | 88 | { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | /** |
93 | 93 | * Who is this email going to (BCC) |
94 | 94 | * |
95 | - * @return array The recipients of the email |
|
95 | + * @return string The recipients of the email |
|
96 | 96 | */ |
97 | 97 | public function getBCCAddresses() |
98 | 98 | { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param string $email The email address to send from |
150 | 150 | * @param string $name The name to associate with the from address |
151 | 151 | */ |
152 | - public function setFromAddress($email, $name=false) |
|
152 | + public function setFromAddress($email, $name = false) |
|
153 | 153 | { |
154 | 154 | $address = $email; |
155 | 155 | if($name !== false) |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @param string $email The email address to send to |
166 | 166 | * @param string $name The name to associate with the address |
167 | 167 | */ |
168 | - public function addToAddress($email, $name=false) |
|
168 | + public function addToAddress($email, $name = false) |
|
169 | 169 | { |
170 | 170 | $this->addAddress($this->to, $email, $name); |
171 | 171 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * @param string $email The email address to send to |
177 | 177 | * @param string $name The name to associate with the address |
178 | 178 | */ |
179 | - public function addCCAddress($email, $name=false) |
|
179 | + public function addCCAddress($email, $name = false) |
|
180 | 180 | { |
181 | 181 | $this->addAddress($this->cc, $email, $name); |
182 | 182 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param string $email The email address to send to |
188 | 188 | * @param string $name The name to associate with the address |
189 | 189 | */ |
190 | - public function addBCCAddress($email, $name=false) |
|
190 | + public function addBCCAddress($email, $name = false) |
|
191 | 191 | { |
192 | 192 | $this->addAddress($this->bcc, $email, $name); |
193 | 193 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @param string $email The email address to send to |
200 | 200 | * @param string $name The name to associate with the address |
201 | 201 | */ |
202 | - protected function addAddress(&$list, $email, $name=false) |
|
202 | + protected function addAddress(&$list, $email, $name = false) |
|
203 | 203 | { |
204 | 204 | $address = $email; |
205 | 205 | if($name !== false) |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @param string $email The email address to reply to |
216 | 216 | * @param string $name The name to associate with the from address |
217 | 217 | */ |
218 | - public function setReplyTo($email, $name=false) |
|
218 | + public function setReplyTo($email, $name = false) |
|
219 | 219 | { |
220 | 220 | $address = $email; |
221 | 221 | if($name !== false) |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function appendToHTMLBody($body) |
264 | 264 | { |
265 | - $this->htmlBody.= $body; |
|
265 | + $this->htmlBody .= $body; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function appendToTextBody($body) |
274 | 274 | { |
275 | - $this->textBody.= $body; |
|
275 | + $this->textBody .= $body; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
@@ -335,14 +335,14 @@ discard block |
||
335 | 335 | { |
336 | 336 | throw new \Exception('Message must have a from address'); |
337 | 337 | } |
338 | - $rawMessage.= 'From: '.$this->encodeRecipients($from)."\n"; |
|
338 | + $rawMessage .= 'From: '.$this->encodeRecipients($from)."\n"; |
|
339 | 339 | if(!empty($this->cc)) |
340 | 340 | { |
341 | - $rawMessage.= 'CC: '. $this->encodeRecipients($this->getCCAddresses())."\n"; |
|
341 | + $rawMessage .= 'CC: '.$this->encodeRecipients($this->getCCAddresses())."\n"; |
|
342 | 342 | } |
343 | 343 | if(!empty($this->bcc)) |
344 | 344 | { |
345 | - $rawMessage.= 'BCC: '. $this->encodeRecipients($this->getBCCAddresses())."\n"; |
|
345 | + $rawMessage .= 'BCC: '.$this->encodeRecipients($this->getBCCAddresses())."\n"; |
|
346 | 346 | } |
347 | 347 | $rawMessage .= 'Subject: '.$this->getSubject()."\n"; |
348 | 348 | $rawMessage .= 'MIME-Version: 1.0'."\n"; |
@@ -352,25 +352,25 @@ discard block |
||
352 | 352 | $textBody = $this->getTextBody(); |
353 | 353 | if($textBody !== false && strlen($textBody) > 0) |
354 | 354 | { |
355 | - $rawMessage.= "\n--alt-{$boundary}\n"; |
|
356 | - $rawMessage.= "Content-Type: text/plain\n\n"; |
|
357 | - $rawMessage.= $textBody."\n"; |
|
355 | + $rawMessage .= "\n--alt-{$boundary}\n"; |
|
356 | + $rawMessage .= "Content-Type: text/plain\n\n"; |
|
357 | + $rawMessage .= $textBody."\n"; |
|
358 | 358 | } |
359 | - $htmlBody = $this->getHTMLBody(); |
|
359 | + $htmlBody = $this->getHTMLBody(); |
|
360 | 360 | if($htmlBody !== false && strlen($htmlBody) > 0) |
361 | 361 | { |
362 | 362 | $rawMessage .= "\n--alt-{$boundary}\n"; |
363 | 363 | $rawMessage .= 'Content-Type: text/html; charset="UTF-8"'."\n\n"; |
364 | 364 | $rawMessage .= $htmlBody."\n"; |
365 | 365 | } |
366 | - $rawMessage.= "\n--alt-{$boundary}--\n"; |
|
366 | + $rawMessage .= "\n--alt-{$boundary}--\n"; |
|
367 | 367 | foreach($this->attachments as $attachment) |
368 | 368 | { |
369 | - $rawMessage.= "\n--{$boundary}\n"; |
|
370 | - $rawMessage.= 'Content-Type: '. $attachment['mimeType'].'; name="'.$attachment['name']."\"\n"; |
|
371 | - $rawMessage.= 'Content-Disposition: attachment'."\n"; |
|
372 | - $rawMessage.= 'Content-Transfer-Encoding: base64'."\n\n"; |
|
373 | - $rawMessage.= chunk_split(base64_encode($attachment['data']), 76, "\n")."\n"; |
|
369 | + $rawMessage .= "\n--{$boundary}\n"; |
|
370 | + $rawMessage .= 'Content-Type: '.$attachment['mimeType'].'; name="'.$attachment['name']."\"\n"; |
|
371 | + $rawMessage .= 'Content-Disposition: attachment'."\n"; |
|
372 | + $rawMessage .= 'Content-Transfer-Encoding: base64'."\n\n"; |
|
373 | + $rawMessage .= chunk_split(base64_encode($attachment['data']), 76, "\n")."\n"; |
|
374 | 374 | } |
375 | 375 | $rawMessage .= "\n--{$boundary}--\n"; |
376 | 376 | return $rawMessage; |
@@ -12,6 +12,9 @@ |
||
12 | 12 | return false; |
13 | 13 | } |
14 | 14 | |
15 | + /** |
|
16 | + * @param Email $email |
|
17 | + */ |
|
15 | 18 | public function sendEmail($email) |
16 | 19 | { |
17 | 20 | return false; |
@@ -117,6 +117,9 @@ discard block |
||
117 | 117 | $this->connect = false; |
118 | 118 | } |
119 | 119 | |
120 | + /** |
|
121 | + * @param string $password |
|
122 | + */ |
|
120 | 123 | function bind($cn=null, $password=null) |
121 | 124 | { |
122 | 125 | $res = false; |
@@ -199,6 +202,9 @@ discard block |
||
199 | 202 | return $ret; |
200 | 203 | } |
201 | 204 | |
205 | + /** |
|
206 | + * @param boolean $filter |
|
207 | + */ |
|
202 | 208 | private function filterToString($filter) |
203 | 209 | { |
204 | 210 | if($filter === false) |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $this->ds = ldap_connect($this->connect); |
77 | 77 | } |
78 | 78 | |
79 | - private function getConnectString($name, $proto=false) |
|
79 | + private function getConnectString($name, $proto = false) |
|
80 | 80 | { |
81 | 81 | if(strstr($name, ':') !== false) |
82 | 82 | { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | return $name; |
90 | 90 | } |
91 | 91 | |
92 | - function connect($name, $proto=false) |
|
92 | + function connect($name, $proto = false) |
|
93 | 93 | { |
94 | 94 | $connectStr = $this->getConnectString($name, $proto); |
95 | 95 | if($this->ds !== null) |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $this->connect = false; |
118 | 118 | } |
119 | 119 | |
120 | - function bind($cn=null, $password=null) |
|
120 | + function bind($cn = null, $password = null) |
|
121 | 121 | { |
122 | 122 | $res = false; |
123 | 123 | if($this->ds === null) |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | return $filter->to_ldap_string(); |
215 | 215 | } |
216 | 216 | |
217 | - function read($baseDN, $filter=false, $single=false, $attributes=false) |
|
217 | + function read($baseDN, $filter = false, $single = false, $attributes = false) |
|
218 | 218 | { |
219 | 219 | $filterStr = $this->filterToString($filter); |
220 | 220 | if($this->ds === null) |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | return $res; |
262 | 262 | } |
263 | 263 | |
264 | - function count($baseDN, $filter=false) |
|
264 | + function count($baseDN, $filter = false) |
|
265 | 265 | { |
266 | 266 | $filterStr = $this->filterToString($filter); |
267 | 267 | if($this->ds === null) |
@@ -264,7 +264,7 @@ |
||
264 | 264 | throw new \Exception('data must be set for LDAPGroup'); |
265 | 265 | } |
266 | 266 | $filter = new \Data\Filter("cn eq $name"); |
267 | - $group = $data->read($data->group_base, $filter); |
|
267 | + $group = $data->read($data->group_base, $filter); |
|
268 | 268 | if($group === false || !isset($group[0])) |
269 | 269 | { |
270 | 270 | return false; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | return substr($split[0], 4); |
73 | 73 | } |
74 | 74 | |
75 | - public function getMemberUids($recursive=true) |
|
75 | + public function getMemberUids($recursive = true) |
|
76 | 76 | { |
77 | 77 | $members = array(); |
78 | 78 | $rawMembers = $this->getMembersField(); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | return LDAPUser::from_name(substr($split[0], 4), $this->server); |
118 | 118 | } |
119 | 119 | |
120 | - public function members($details=false, $recursive=true, $includeGroups=true) |
|
120 | + public function members($details = false, $recursive = true, $includeGroups = true) |
|
121 | 121 | { |
122 | 122 | $members = array(); |
123 | 123 | $rawMembers = $this->getMembersField(); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | return $members; |
155 | 155 | } |
156 | 156 | |
157 | - public function getNonMemebers($select=false) |
|
157 | + public function getNonMemebers($select = false) |
|
158 | 158 | { |
159 | 159 | $data = array(); |
160 | 160 | $groupFilter = '(&(cn=*)(!(cn='.$this->getGroupName().'))'; |
@@ -163,18 +163,18 @@ discard block |
||
163 | 163 | $count = count($members); |
164 | 164 | for($i = 0; $i < $count; $i++) |
165 | 165 | { |
166 | - $dnComps = explode(',',$members[$i]); |
|
166 | + $dnComps = explode(',', $members[$i]); |
|
167 | 167 | if(strncmp($members[$i], "uid=", 4) == 0) |
168 | 168 | { |
169 | - $userFilter.='(!('.$dnComps[0].'))'; |
|
169 | + $userFilter .= '(!('.$dnComps[0].'))'; |
|
170 | 170 | } |
171 | 171 | else |
172 | 172 | { |
173 | - $groupFilter.='(!('.$dnComps[0].'))'; |
|
173 | + $groupFilter .= '(!('.$dnComps[0].'))'; |
|
174 | 174 | } |
175 | 175 | } |
176 | - $userFilter.=')'; |
|
177 | - $groupFilter.=')'; |
|
176 | + $userFilter .= ')'; |
|
177 | + $groupFilter .= ')'; |
|
178 | 178 | $groups = $this->server->read($this->server->group_base, $groupFilter); |
179 | 179 | $count = count($groups); |
180 | 180 | for($i = 0; $i < $count; $i++) |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
210 | - public function addMember($name, $isGroup=false, $flush=true) |
|
210 | + public function addMember($name, $isGroup = false, $flush = true) |
|
211 | 211 | { |
212 | 212 | $dn = false; |
213 | 213 | if($isGroup) |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | } |
255 | 255 | } |
256 | 256 | |
257 | - static function from_dn($dn, $data=false) |
|
257 | + static function from_dn($dn, $data = false) |
|
258 | 258 | { |
259 | 259 | if($data === false) |
260 | 260 | { |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | return new static($group[0]); |
269 | 269 | } |
270 | 270 | |
271 | - static function from_name($name, $data=false) |
|
271 | + static function from_name($name, $data = false) |
|
272 | 272 | { |
273 | 273 | if($data === false) |
274 | 274 | { |
@@ -179,7 +179,10 @@ |
||
179 | 179 | $count = count($groups); |
180 | 180 | for($i = 0; $i < $count; $i++) |
181 | 181 | { |
182 | - if($groups[$i] === false || $groups[$i] === null) continue; |
|
182 | + if($groups[$i] === false || $groups[$i] === null) |
|
183 | + { |
|
184 | + continue; |
|
185 | + } |
|
183 | 186 | array_push($data, new LDAPGroup($groups[$i])); |
184 | 187 | } |
185 | 188 | $users = $this->server->read($this->server->user_base, $userFilter, false, $select); |