@@ -17,6 +17,9 @@ discard block |
||
17 | 17 | private $kick_muc_members = false; // Set to true when locking a MUC, so users are kicked from the room. |
18 | 18 | /***/ |
19 | 19 | |
20 | + /** |
|
21 | + * @param Jabber $jab |
|
22 | + */ |
|
20 | 23 | function __construct(&$jab) { |
21 | 24 | $this->jab = &$jab; |
22 | 25 | $this->first_roster_update = true; |
@@ -91,6 +94,12 @@ discard block |
||
91 | 94 | /************************************** |
92 | 95 | ******* MUC Rooms |
93 | 96 | **************************************/ |
97 | + |
|
98 | + /** |
|
99 | + * @param string|null $muc_room_full_name |
|
100 | + * @param string|null $muc_room_description |
|
101 | + * @param string|null $muc_room_owner_username |
|
102 | + */ |
|
94 | 103 | function set_muc_room_info($muc_room_short_name, $muc_room_full_name, $muc_room_description, $muc_room_owner_username){ |
95 | 104 | $this->muc_room_info = array ( |
96 | 105 | "muc_room_short_name" => $muc_room_short_name, |
@@ -590,6 +590,10 @@ discard block |
||
590 | 590 | /* |
591 | 591 | * Adds/updates a property's value to the Openfire's DB. |
592 | 592 | */ |
593 | + |
|
594 | + /** |
|
595 | + * @param string $property |
|
596 | + */ |
|
593 | 597 | function _add_property($property,$value){ |
594 | 598 | $this->_db_connect($this->arguments["USER_OF_DB"],$this->arguments["PWD_OF_DB"],$this->arguments["OF_DB_HOST"],$this->arguments["OF_DB_PORT"],$this->arguments["OF_DB_NAME"]); |
595 | 599 | |
@@ -619,6 +623,11 @@ discard block |
||
619 | 623 | /* |
620 | 624 | * Adds/updates a muc property's value to the Openfire's DB. |
621 | 625 | */ |
626 | + |
|
627 | + /** |
|
628 | + * @param string $property |
|
629 | + * @param string $value |
|
630 | + */ |
|
622 | 631 | function _add_muc_property($property,$value){ |
623 | 632 | $this->_db_connect($this->arguments["USER_OF_DB"],$this->arguments["PWD_OF_DB"],$this->arguments["OF_DB_HOST"],$this->arguments["OF_DB_PORT"],$this->arguments["OF_DB_NAME"]); |
624 | 633 |
@@ -18,6 +18,10 @@ discard block |
||
18 | 18 | /* |
19 | 19 | * Initialize configuration |
20 | 20 | */ |
21 | + |
|
22 | + /** |
|
23 | + * @param boolean $session |
|
24 | + */ |
|
21 | 25 | public function __construct($session) { |
22 | 26 | $session = trim($session); |
23 | 27 | if(!isset($session) || !is_string($session) || empty($session)){ |
@@ -134,6 +138,10 @@ discard block |
||
134 | 138 | /* |
135 | 139 | * Auxiliary function for lock_muc_room and unlock_muc_room. |
136 | 140 | */ |
141 | + |
|
142 | + /** |
|
143 | + * @param string $muc_room_short_name |
|
144 | + */ |
|
137 | 145 | private function _muc_locker($muc_room_short_name, $lock = true) |
138 | 146 | { |
139 | 147 | if( !$this->check_parameters->NotEmptyString($muc_room_short_name) ){ |
@@ -429,6 +437,10 @@ discard block |
||
429 | 437 | /* |
430 | 438 | * Revoke membership of a user in a muc room |
431 | 439 | */ |
440 | + |
|
441 | + /** |
|
442 | + * @param string $username |
|
443 | + */ |
|
432 | 444 | public function muc_remove_member($muc_room_short_name, $username){ |
433 | 445 | $muc_room_short_name = strtolower($muc_room_short_name); |
434 | 446 | $username = strtolower($username); |
@@ -24,6 +24,10 @@ discard block |
||
24 | 24 | * @param muc_room_description string Short description of the Room. Mapped from project's "Short Description". |
25 | 25 | * @param muc_room_owner_username string The username of who's creating the room. Mapped from project owner. |
26 | 26 | */ |
27 | + |
|
28 | + /** |
|
29 | + * @return boolean |
|
30 | + */ |
|
27 | 31 | function create_muc_room($muc_room_short_name, $muc_room_full_name, $muc_room_description, $muc_room_owner_username); |
28 | 32 | |
29 | 33 | |
@@ -80,6 +84,10 @@ discard block |
||
80 | 84 | * @param group_short_name Index of the group. Mapped from project's "Short Name". |
81 | 85 | * @param group_full_name string Displayed on the Members' roster. Mapped from project's "Full Name". |
82 | 86 | */ |
87 | + |
|
88 | + /** |
|
89 | + * @return boolean |
|
90 | + */ |
|
83 | 91 | function create_shared_group($group_short_name, $group_full_name); |
84 | 92 | |
85 | 93 | /* |
@@ -5,14 +5,28 @@ |
||
5 | 5 | * Uses the information of the global variables of the class to |
6 | 6 | * make a shared group available by setting its parameters. |
7 | 7 | */ |
8 | + |
|
9 | + /** |
|
10 | + * @return void |
|
11 | + */ |
|
8 | 12 | function create_shared_group(); |
9 | 13 | |
14 | + /** |
|
15 | + * @return void |
|
16 | + */ |
|
10 | 17 | function set_group_short_name($short_name); |
18 | + |
|
19 | + /** |
|
20 | + * @return void |
|
21 | + */ |
|
11 | 22 | function set_group_full_name($full_name); |
12 | 23 | function get_group_short_name(); |
13 | 24 | function get_group_full_name(); |
14 | 25 | public function get_log(); |
15 | 26 | |
27 | + /** |
|
28 | + * @return void |
|
29 | + */ |
|
16 | 30 | function set_jab_connector(&$jab); |
17 | 31 | |
18 | 32 | } |
@@ -44,9 +44,17 @@ |
||
44 | 44 | public function set_group_short_name($short_name){ |
45 | 45 | $this->group_short_name = $short_name; |
46 | 46 | } |
47 | + |
|
48 | + /** |
|
49 | + * @param string $full_name |
|
50 | + */ |
|
47 | 51 | public function set_group_full_name($full_name){ |
48 | 52 | $this->group_full_name = $full_name; |
49 | 53 | } |
54 | + |
|
55 | + /** |
|
56 | + * @param Jabber $jab |
|
57 | + */ |
|
50 | 58 | public function set_jab_connector(&$jab){ |
51 | 59 | $this->jab = &$jab; |
52 | 60 | } |
@@ -188,6 +188,10 @@ discard block |
||
188 | 188 | if (function_exists('mhash')) { // is the Mhash extension installed? |
189 | 189 | |
190 | 190 | // implement the sha1() function using mhash |
191 | + |
|
192 | + /** |
|
193 | + * @param string $str |
|
194 | + */ |
|
191 | 195 | function sha1($str) { |
192 | 196 | return bin2hex(mhash(MHASH_SHA1, $str)); |
193 | 197 | } |
@@ -360,12 +364,20 @@ discard block |
||
360 | 364 | |
361 | 365 | |
362 | 366 | // returns a unique ID to be sent with packets |
367 | + |
|
368 | + /** |
|
369 | + * @param string $prefix |
|
370 | + */ |
|
363 | 371 | function _unique_id($prefix) { |
364 | 372 | $this->_unique_counter++; |
365 | 373 | return $prefix."_" . md5(time() . $this->_remote_ip . $this->_unique_counter); |
366 | 374 | } |
367 | 375 | |
368 | 376 | // public method for creating a log entry |
377 | + |
|
378 | + /** |
|
379 | + * @param string $msg |
|
380 | + */ |
|
369 | 381 | function log($msg,$level=1) { |
370 | 382 | $this->_log($msg,$level); |
371 | 383 | } |
@@ -449,6 +461,10 @@ discard block |
||
449 | 461 | // specify the correct IP to connect to here |
450 | 462 | // |
451 | 463 | // |
464 | + |
|
465 | + /** |
|
466 | + * @param string $server_host |
|
467 | + */ |
|
452 | 468 | function connect($server_host,$server_port=5222,$connect_timeout=null,$alternate_ip=false) { |
453 | 469 | |
454 | 470 | if (is_null($connect_timeout)) $connect_timeout = DEFAULT_CONNECT_TIMEOUT; |
@@ -545,11 +561,20 @@ discard block |
||
545 | 561 | |
546 | 562 | // sets a user's presence (when simply used to set your availability, it's more convenient |
547 | 563 | // to call this way, as usually only the first 2 fields are necessary) |
564 | + |
|
565 | + /** |
|
566 | + * @param string $show |
|
567 | + * @param string $status |
|
568 | + */ |
|
548 | 569 | function set_presence($show = NULL, $status = NULL, $to = NULL, $priority = NULL) { |
549 | 570 | return $this->send_presence(NULL,$to,$show,$status,$priority); |
550 | 571 | } |
551 | 572 | |
552 | 573 | // sends presence to another contact/entity |
574 | + |
|
575 | + /** |
|
576 | + * @param string $type |
|
577 | + */ |
|
553 | 578 | function send_presence($type = NULL, $to = NULL, $show = NULL, $status = NULL, $priority = NULL) { |
554 | 579 | $xml = "<presence"; |
555 | 580 | $xml .= ($to) ? " to='$to'" : ''; |
@@ -586,6 +611,9 @@ discard block |
||
586 | 611 | return strtr($string, $trans); |
587 | 612 | } |
588 | 613 | |
614 | + /** |
|
615 | + * @param string $payload |
|
616 | + */ |
|
589 | 617 | function message($to, $type = "normal", $id = NULL, $body = NULL, $thread = NULL, $subject = NULL, $payload = NULL, $raw = false) { |
590 | 618 | if ($to && ($body || $subject || $payload)) { |
591 | 619 | if (!$id) $id = $this->_unique_id("msg"); |
@@ -939,6 +967,11 @@ discard block |
||
939 | 967 | |
940 | 968 | // Sets a handler for a particular IQ packet ID (and optionally packet type). |
941 | 969 | // Assumes that $method is the name of a method of $this |
970 | + |
|
971 | + /** |
|
972 | + * @param string $method |
|
973 | + * @param string $type |
|
974 | + */ |
|
942 | 975 | function _set_iq_handler($method,$id,$type=NULL) { |
943 | 976 | if (is_null($type)) $type = "_all"; |
944 | 977 | $this->_iq_handlers[$id][$type] = array(&$this,$method); |
@@ -1477,6 +1510,10 @@ discard block |
||
1477 | 1510 | } |
1478 | 1511 | |
1479 | 1512 | // request software version from a JabberID |
1513 | + |
|
1514 | + /** |
|
1515 | + * @param string $jid |
|
1516 | + */ |
|
1480 | 1517 | function request_version($jid) { |
1481 | 1518 | |
1482 | 1519 | $this->_log('Requesting version information from '.$jid); |
@@ -2048,6 +2085,9 @@ discard block |
||
2048 | 2085 | return $transport; |
2049 | 2086 | } |
2050 | 2087 | |
2088 | + /** |
|
2089 | + * @param string $domain |
|
2090 | + */ |
|
2051 | 2091 | function get_transport($domain) { |
2052 | 2092 | $transport = @$this->services[$domain]["type"]; |
2053 | 2093 | return $this->standardize_transport($transport); |
@@ -2060,6 +2100,11 @@ discard block |
||
2060 | 2100 | // ==== Packet Handling & Connection Methods ============================================= |
2061 | 2101 | |
2062 | 2102 | // generates and transmits an IQ packet |
2103 | + |
|
2104 | + /** |
|
2105 | + * @param string $xmlns |
|
2106 | + * @param string $from |
|
2107 | + */ |
|
2063 | 2108 | function _send_iq($to = NULL, $type = 'get', $id = NULL, $xmlns = NULL, $payload = NULL, $from = NULL) { |
2064 | 2109 | if (!preg_match("/^(get|set|result|error)$/", $type)) { |
2065 | 2110 | unset($type); |
@@ -2166,6 +2211,9 @@ discard block |
||
2166 | 2211 | return array_shift($this->_packet_queue); |
2167 | 2212 | } |
2168 | 2213 | |
2214 | + /** |
|
2215 | + * @param string $incoming |
|
2216 | + */ |
|
2169 | 2217 | function _split_incoming($incoming) { |
2170 | 2218 | $temp = preg_split("/<(message|iq|presence|stream)(?=[\:\s\>])/", $incoming, -1, PREG_SPLIT_DELIM_CAPTURE); |
2171 | 2219 | $array = array(); |
@@ -129,6 +129,10 @@ discard block |
||
129 | 129 | * Perform the appropriate triplet combination function for the current |
130 | 130 | * iteration |
131 | 131 | */ |
132 | + |
|
133 | + /** |
|
134 | + * @param integer $t |
|
135 | + */ |
|
132 | 136 | function sha1_ft($t, $b, $c, $d) |
133 | 137 | { |
134 | 138 | if($t < 20) return ($b & $c) | ((~$b) & $d); |
@@ -142,6 +146,10 @@ discard block |
||
142 | 146 | * Silly php does not understand the inline-if operator well when nested, |
143 | 147 | * so that's why it's ()ed now. |
144 | 148 | */ |
149 | + |
|
150 | + /** |
|
151 | + * @param integer $t |
|
152 | + */ |
|
145 | 153 | function sha1_kt($t) |
146 | 154 | { |
147 | 155 | return ($t < 20) ? 1518500249 : (($t < 40) ? 1859775393 : |
@@ -183,6 +191,10 @@ discard block |
||
183 | 191 | /* |
184 | 192 | * Bitwise rotate a 32-bit number to the left. |
185 | 193 | */ |
194 | + |
|
195 | + /** |
|
196 | + * @param integer $cnt |
|
197 | + */ |
|
186 | 198 | function rol($num, $cnt) |
187 | 199 | { |
188 | 200 | return ($num << $cnt) | $this->zerofill_rightshift($num, (32 - $cnt)); |
@@ -254,6 +266,9 @@ discard block |
||
254 | 266 | |
255 | 267 | if ( !function_exists('sha1') ) |
256 | 268 | { |
269 | + /** |
|
270 | + * @param string $string |
|
271 | + */ |
|
257 | 272 | function sha1( $string, $raw_output = false ) |
258 | 273 | { |
259 | 274 | $library = &new SHA1Library(); |
@@ -73,6 +73,9 @@ |
||
73 | 73 | // _xml_depth() |
74 | 74 | // (c) Hans Anderson / http://www.hansanderson.com/php/xml/ |
75 | 75 | |
76 | + /** |
|
77 | + * @param integer $i |
|
78 | + */ |
|
76 | 79 | function _xml_depth($vals, &$i) { |
77 | 80 | $children = array(); |
78 | 81 |