@@ -141,6 +141,9 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | +/** |
|
| 145 | + * @param string $setting |
|
| 146 | + */ |
|
| 144 | 147 | function getSettingValue($setting) { |
| 145 | 148 | |
| 146 | 149 | // get default language |
@@ -1999,6 +2002,9 @@ discard block |
||
| 1999 | 2002 | } |
| 2000 | 2003 | } |
| 2001 | 2004 | |
| 2005 | +/** |
|
| 2006 | + * @param string $type |
|
| 2007 | + */ |
|
| 2002 | 2008 | function rest_error ($type,$detail = 'N/A') { |
| 2003 | 2009 | switch ($type) { |
| 2004 | 2010 | case 'APIKEY': |
@@ -349,8 +349,7 @@ discard block |
||
| 349 | 349 | |
| 350 | 350 | $x++; |
| 351 | 351 | } |
| 352 | - } |
|
| 353 | - else if($GLOBALS['request'][1] == "userpw") { |
|
| 352 | + } else if($GLOBALS['request'][1] == "userpw") { |
|
| 354 | 353 | /* |
| 355 | 354 | * READ USER ITEMS |
| 356 | 355 | */ |
@@ -434,8 +433,7 @@ discard block |
||
| 434 | 433 | |
| 435 | 434 | $x++; |
| 436 | 435 | } |
| 437 | - } |
|
| 438 | - else if($GLOBALS['request'][1] == "userfolders") { |
|
| 436 | + } else if($GLOBALS['request'][1] == "userfolders") { |
|
| 439 | 437 | /* |
| 440 | 438 | * READ USER FOLDERS |
| 441 | 439 | * Sends back a list of folders |
@@ -478,8 +476,7 @@ discard block |
||
| 478 | 476 | } |
| 479 | 477 | } |
| 480 | 478 | } |
| 481 | - } |
|
| 482 | - elseif($GLOBALS['request'][1] == "items") { |
|
| 479 | + } elseif($GLOBALS['request'][1] == "items") { |
|
| 483 | 480 | /* |
| 484 | 481 | * READ ITEMS asked |
| 485 | 482 | */ |
@@ -826,8 +823,11 @@ discard block |
||
| 826 | 823 | "SELECT `id` FROM ".prefix_table("roles_title")." WHERE title = %s", |
| 827 | 824 | $role |
| 828 | 825 | ); |
| 829 | - if (empty($rolesList)) $rolesList = $tmp['id']; |
|
| 830 | - else $rolesList .= ";" . $tmp['id']; |
|
| 826 | + if (empty($rolesList)) { |
|
| 827 | + $rolesList = $tmp['id']; |
|
| 828 | + } else { |
|
| 829 | + $rolesList .= ";" . $tmp['id']; |
|
| 830 | + } |
|
| 831 | 831 | } |
| 832 | 832 | |
| 833 | 833 | // Add user in DB |
@@ -899,8 +899,12 @@ discard block |
||
| 899 | 899 | $params = explode(';', base64_decode($GLOBALS['request'][2])); |
| 900 | 900 | |
| 901 | 901 | if (!empty($params[0]) && !empty($params[1])) { |
| 902 | - if (empty($params[3])) $params[3] = 0; |
|
| 903 | - if (empty($params[4])) $params[4] = 0; |
|
| 902 | + if (empty($params[3])) { |
|
| 903 | + $params[3] = 0; |
|
| 904 | + } |
|
| 905 | + if (empty($params[4])) { |
|
| 906 | + $params[4] = 0; |
|
| 907 | + } |
|
| 904 | 908 | if ($params[2] < 0) { |
| 905 | 909 | rest_error ('NO_DATA_EXIST'); |
| 906 | 910 | } |
@@ -1140,7 +1144,9 @@ discard block |
||
| 1140 | 1144 | if ($params[1] < 0) { |
| 1141 | 1145 | rest_error ('NO_DATA_EXIST'); |
| 1142 | 1146 | } |
| 1143 | - if (empty($params[2])) $params[2] = 0; |
|
| 1147 | + if (empty($params[2])) { |
|
| 1148 | + $params[2] = 0; |
|
| 1149 | + } |
|
| 1144 | 1150 | |
| 1145 | 1151 | // check if folder exists and get folder data |
| 1146 | 1152 | $data_folder = DB::queryfirstrow("SELECT * FROM ".prefix_table("nested_tree")." WHERE id = %s", $GLOBALS['request'][2]); |
@@ -1886,13 +1892,27 @@ discard block |
||
| 1886 | 1892 | if (!empty($GLOBALS['request'][1])) { |
| 1887 | 1893 | $params = explode(";", $GLOBALS['request'][1]); |
| 1888 | 1894 | |
| 1889 | - if (empty($params[0])) $params[0] = 8; |
|
| 1890 | - if (empty($params[1])) $params[1] = 0; |
|
| 1891 | - if (empty($params[2])) $params[2] = 0; |
|
| 1892 | - if (empty($params[3])) $params[3] = 0; |
|
| 1893 | - if (empty($params[4])) $params[4] = 0; |
|
| 1894 | - if (empty($params[5])) $params[5] = 0; |
|
| 1895 | - if (empty($params[6])) $params[6] = 0; |
|
| 1895 | + if (empty($params[0])) { |
|
| 1896 | + $params[0] = 8; |
|
| 1897 | + } |
|
| 1898 | + if (empty($params[1])) { |
|
| 1899 | + $params[1] = 0; |
|
| 1900 | + } |
|
| 1901 | + if (empty($params[2])) { |
|
| 1902 | + $params[2] = 0; |
|
| 1903 | + } |
|
| 1904 | + if (empty($params[3])) { |
|
| 1905 | + $params[3] = 0; |
|
| 1906 | + } |
|
| 1907 | + if (empty($params[4])) { |
|
| 1908 | + $params[4] = 0; |
|
| 1909 | + } |
|
| 1910 | + if (empty($params[5])) { |
|
| 1911 | + $params[5] = 0; |
|
| 1912 | + } |
|
| 1913 | + if (empty($params[6])) { |
|
| 1914 | + $params[6] = 0; |
|
| 1915 | + } |
|
| 1896 | 1916 | |
| 1897 | 1917 | // load library |
| 1898 | 1918 | require_once '../sources/SplClassLoader.php'; |
@@ -1902,11 +1922,21 @@ discard block |
||
| 1902 | 1922 | |
| 1903 | 1923 | // init |
| 1904 | 1924 | $pwgen->setLength($params[0]); |
| 1905 | - if($params[1] === "1") $pwgen->setSecure(true); |
|
| 1906 | - if($params[2] === "1") $pwgen->setNumerals(true); |
|
| 1907 | - if($params[3] === "1") $pwgen->setCapitalize(true); |
|
| 1908 | - if($params[4] === "1") $pwgen->setAmbiguous(true); |
|
| 1909 | - if($params[5] === "1" && $params[6] === "1") $pwgen->setSymbols(true); |
|
| 1925 | + if($params[1] === "1") { |
|
| 1926 | + $pwgen->setSecure(true); |
|
| 1927 | + } |
|
| 1928 | + if($params[2] === "1") { |
|
| 1929 | + $pwgen->setNumerals(true); |
|
| 1930 | + } |
|
| 1931 | + if($params[3] === "1") { |
|
| 1932 | + $pwgen->setCapitalize(true); |
|
| 1933 | + } |
|
| 1934 | + if($params[4] === "1") { |
|
| 1935 | + $pwgen->setAmbiguous(true); |
|
| 1936 | + } |
|
| 1937 | + if($params[5] === "1" && $params[6] === "1") { |
|
| 1938 | + $pwgen->setSymbols(true); |
|
| 1939 | + } |
|
| 1910 | 1940 | |
| 1911 | 1941 | // generate and send back (generate in base64 if symbols are asked) |
| 1912 | 1942 | if ($params[6] === "1") { |
@@ -40,6 +40,10 @@ |
||
| 40 | 40 | return $response['flickerCode']; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $response |
|
| 45 | + * @param string $hedgeId |
|
| 46 | + */ |
|
| 43 | 47 | function verifyResponse($apn, $response, $hedgeId) { |
| 44 | 48 | |
| 45 | 49 | $serviceCall = $this->baseUrl."/authmessage/".$apn."/verify/".$hedgeId."/".$response; |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | * Base64 character set "./[A-Z][a-z][0-9]" |
| 83 | 83 | * |
| 84 | 84 | * @param string $src |
| 85 | - * @return string|bool |
|
| 85 | + * @return string|false |
|
| 86 | 86 | * @throws \RangeException |
| 87 | 87 | */ |
| 88 | 88 | public static function decode($src, $strictPadding = false) |
@@ -1458,7 +1458,7 @@ discard block |
||
| 1458 | 1458 | * |
| 1459 | 1459 | * May need to be overwritten by classes extending this one in some cases |
| 1460 | 1460 | * |
| 1461 | - * @return int |
|
| 1461 | + * @return string|null |
|
| 1462 | 1462 | * @access private |
| 1463 | 1463 | */ |
| 1464 | 1464 | function _openssl_translate_mode() |
@@ -2541,7 +2541,7 @@ discard block |
||
| 2541 | 2541 | * |
| 2542 | 2542 | * @see self::_setupInlineCrypt() |
| 2543 | 2543 | * @access private |
| 2544 | - * @param $bytes |
|
| 2544 | + * @param string $bytes |
|
| 2545 | 2545 | * @return string |
| 2546 | 2546 | */ |
| 2547 | 2547 | function _hashInlineCryptFunction($bytes) |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | * As set by the constructor or by the setHash() method. |
| 148 | 148 | * |
| 149 | 149 | * @access public |
| 150 | - * @return string |
|
| 150 | + * @return integer |
|
| 151 | 151 | */ |
| 152 | 152 | function getHash() |
| 153 | 153 | { |
@@ -201,8 +201,8 @@ |
||
| 201 | 201 | * Keys can be between 1 and 256 bytes long. |
| 202 | 202 | * |
| 203 | 203 | * @access public |
| 204 | - * @param int $length |
|
| 205 | 204 | * @throws \LengthException if the key length is invalid |
| 205 | + * @param string $key |
|
| 206 | 206 | */ |
| 207 | 207 | function setKey($key) |
| 208 | 208 | { |
@@ -402,7 +402,6 @@ discard block |
||
| 402 | 402 | * @access public |
| 403 | 403 | * @param int $bits |
| 404 | 404 | * @param int $timeout |
| 405 | - * @param array $p |
|
| 406 | 405 | */ |
| 407 | 406 | static function createKey($bits = 2048, $timeout = false, $partial = array()) |
| 408 | 407 | { |
@@ -608,7 +607,7 @@ discard block |
||
| 608 | 607 | * @see self::load() |
| 609 | 608 | * @param string $fullname |
| 610 | 609 | * @access public |
| 611 | - * @return bool |
|
| 610 | + * @return boolean|null |
|
| 612 | 611 | */ |
| 613 | 612 | static function addFileFormat($fullname) |
| 614 | 613 | { |
@@ -750,7 +749,7 @@ discard block |
||
| 750 | 749 | * |
| 751 | 750 | * @see self::load() |
| 752 | 751 | * @access public |
| 753 | - * @return mixed |
|
| 752 | + * @return false|string |
|
| 754 | 753 | */ |
| 755 | 754 | function getLoadedFormat() |
| 756 | 755 | { |
@@ -971,7 +970,7 @@ discard block |
||
| 971 | 970 | * @access public |
| 972 | 971 | * @param string $algorithm The hashing algorithm to be used. Valid options are 'md5' and 'sha256'. False is returned |
| 973 | 972 | * for invalid values. |
| 974 | - * @return mixed |
|
| 973 | + * @return false|string |
|
| 975 | 974 | */ |
| 976 | 975 | function getPublicKeyFingerprint($algorithm = 'md5') |
| 977 | 976 | { |
@@ -1154,7 +1153,6 @@ discard block |
||
| 1154 | 1153 | * of the hash function Hash) and 0. |
| 1155 | 1154 | * |
| 1156 | 1155 | * @access public |
| 1157 | - * @param int $format |
|
| 1158 | 1156 | */ |
| 1159 | 1157 | function setSaltLength($sLen) |
| 1160 | 1158 | { |
@@ -1169,7 +1167,7 @@ discard block |
||
| 1169 | 1167 | * @access private |
| 1170 | 1168 | * @param bool|\phpseclib\Math\BigInteger $x |
| 1171 | 1169 | * @param int $xLen |
| 1172 | - * @return bool|string |
|
| 1170 | + * @return false|string |
|
| 1173 | 1171 | */ |
| 1174 | 1172 | function _i2osp($x, $xLen) |
| 1175 | 1173 | { |
@@ -1405,7 +1403,6 @@ discard block |
||
| 1405 | 1403 | * |
| 1406 | 1404 | * @access private |
| 1407 | 1405 | * @param string $mgfSeed |
| 1408 | - * @param int $mgfLen |
|
| 1409 | 1406 | * @return string |
| 1410 | 1407 | */ |
| 1411 | 1408 | function _mgf1($mgfSeed, $maskLen) |
@@ -1494,7 +1491,7 @@ discard block |
||
| 1494 | 1491 | * @access private |
| 1495 | 1492 | * @param string $c |
| 1496 | 1493 | * @param string $l |
| 1497 | - * @return bool|string |
|
| 1494 | + * @return false|string |
|
| 1498 | 1495 | */ |
| 1499 | 1496 | function _rsaes_oaep_decrypt($c, $l = '') |
| 1500 | 1497 | { |
@@ -1548,7 +1545,7 @@ discard block |
||
| 1548 | 1545 | * |
| 1549 | 1546 | * @access private |
| 1550 | 1547 | * @param string $m |
| 1551 | - * @return bool|string |
|
| 1548 | + * @return false|string |
|
| 1552 | 1549 | * @throws \OutOfBoundsException if strlen($m) > $this->k |
| 1553 | 1550 | */ |
| 1554 | 1551 | function _raw_encrypt($m) |
@@ -1571,7 +1568,7 @@ discard block |
||
| 1571 | 1568 | * @param string $m |
| 1572 | 1569 | * @param bool $pkcs15_compat optional |
| 1573 | 1570 | * @throws \OutOfBoundsException if strlen($m) > $this->k - 11 |
| 1574 | - * @return bool|string |
|
| 1571 | + * @return false|string |
|
| 1575 | 1572 | */ |
| 1576 | 1573 | function _rsaes_pkcs1_v1_5_encrypt($m, $pkcs15_compat = false) |
| 1577 | 1574 | { |
@@ -1629,7 +1626,7 @@ discard block |
||
| 1629 | 1626 | * |
| 1630 | 1627 | * @access private |
| 1631 | 1628 | * @param string $c |
| 1632 | - * @return bool|string |
|
| 1629 | + * @return false|string |
|
| 1633 | 1630 | */ |
| 1634 | 1631 | function _rsaes_pkcs1_v1_5_decrypt($c) |
| 1635 | 1632 | { |
@@ -1711,7 +1708,7 @@ discard block |
||
| 1711 | 1708 | * @param string $m |
| 1712 | 1709 | * @param string $em |
| 1713 | 1710 | * @param int $emBits |
| 1714 | - * @return string |
|
| 1711 | + * @return boolean |
|
| 1715 | 1712 | */ |
| 1716 | 1713 | function _emsa_pss_verify($m, $em, $emBits) |
| 1717 | 1714 | { |
@@ -1756,7 +1753,7 @@ discard block |
||
| 1756 | 1753 | * |
| 1757 | 1754 | * @access private |
| 1758 | 1755 | * @param string $m |
| 1759 | - * @return bool|string |
|
| 1756 | + * @return false|string |
|
| 1760 | 1757 | */ |
| 1761 | 1758 | function _rsassa_pss_sign($m) |
| 1762 | 1759 | { |
@@ -1876,7 +1873,7 @@ discard block |
||
| 1876 | 1873 | * @access private |
| 1877 | 1874 | * @param string $m |
| 1878 | 1875 | * @throws \LengthException if the RSA modulus is too short |
| 1879 | - * @return bool|string |
|
| 1876 | + * @return false|string |
|
| 1880 | 1877 | */ |
| 1881 | 1878 | function _rsassa_pkcs1_v1_5_sign($m) |
| 1882 | 1879 | { |
@@ -2058,7 +2055,7 @@ discard block |
||
| 2058 | 2055 | * @access public |
| 2059 | 2056 | * @param string $plaintext |
| 2060 | 2057 | * @param int $padding optional |
| 2061 | - * @return bool|string |
|
| 2058 | + * @return false|string |
|
| 2062 | 2059 | * @throws \LengthException if the RSA modulus is too short |
| 2063 | 2060 | */ |
| 2064 | 2061 | function encrypt($plaintext, $padding = self::PADDING_OAEP) |
@@ -2080,9 +2077,8 @@ discard block |
||
| 2080 | 2077 | * |
| 2081 | 2078 | * @see self::encrypt() |
| 2082 | 2079 | * @access public |
| 2083 | - * @param string $plaintext |
|
| 2084 | 2080 | * @param int $padding optional |
| 2085 | - * @return bool|string |
|
| 2081 | + * @return false|string |
|
| 2086 | 2082 | */ |
| 2087 | 2083 | function decrypt($ciphertext, $padding = self::PADDING_OAEP) |
| 2088 | 2084 | { |
@@ -2130,7 +2126,7 @@ discard block |
||
| 2130 | 2126 | * @param string $message |
| 2131 | 2127 | * @param string $signature |
| 2132 | 2128 | * @param int $padding optional |
| 2133 | - * @return bool |
|
| 2129 | + * @return boolean|string |
|
| 2134 | 2130 | */ |
| 2135 | 2131 | function verify($message, $signature, $padding = self::PADDING_PSS) |
| 2136 | 2132 | { |
@@ -55,7 +55,6 @@ |
||
| 55 | 55 | * |
| 56 | 56 | * @access public |
| 57 | 57 | * @param string $password |
| 58 | - * @param string $iv |
|
| 59 | 58 | * @param int $length |
| 60 | 59 | * @return string |
| 61 | 60 | */ |
@@ -203,9 +203,8 @@ |
||
| 203 | 203 | /** |
| 204 | 204 | * Set the number of lines that should be logged past the terminal height |
| 205 | 205 | * |
| 206 | - * @param int $x |
|
| 207 | - * @param int $y |
|
| 208 | 206 | * @access public |
| 207 | + * @param integer $history |
|
| 209 | 208 | */ |
| 210 | 209 | function setHistory($history) |
| 211 | 210 | { |