@@ -19,7 +19,6 @@ |
||
| 19 | 19 | use ParagonIE\ConstantTime\Hex; |
| 20 | 20 | use phpseclib\Crypt\Common\BlockCipher; |
| 21 | 21 | use phpseclib\Crypt\AES; |
| 22 | -use phpseclib\Crypt\Base; |
|
| 23 | 22 | use phpseclib\Crypt\DES; |
| 24 | 23 | use phpseclib\Crypt\TripleDES; |
| 25 | 24 | use phpseclib\Math\BigInteger; |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | $symkey = ''; |
| 151 | 151 | $iv = substr($iv, 0, 8); |
| 152 | 152 | while (strlen($symkey) < $length) { |
| 153 | - $symkey.= md5($symkey . $password . $iv, true); |
|
| 153 | + $symkey .= md5($symkey.$password.$iv, true); |
|
| 154 | 154 | } |
| 155 | 155 | return substr($symkey, 0, $length); |
| 156 | 156 | } |
@@ -26,10 +26,8 @@ |
||
| 26 | 26 | |
| 27 | 27 | use ParagonIE\ConstantTime\Base64; |
| 28 | 28 | use ParagonIE\ConstantTime\Hex; |
| 29 | -use phpseclib\Crypt\AES; |
|
| 30 | 29 | use phpseclib\Crypt\DES; |
| 31 | 30 | use phpseclib\Crypt\Random; |
| 32 | -use phpseclib\Crypt\TripleDES; |
|
| 33 | 31 | use phpseclib\Math\BigInteger; |
| 34 | 32 | use phpseclib\Common\Functions\ASN1; |
| 35 | 33 | |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | // coefficient INTEGER -- ti |
| 108 | 108 | // } |
| 109 | 109 | $OtherPrimeInfo = pack('Ca*a*', self::ASN1_INTEGER, ASN1::encodeLength(strlen($primes[$i]->toBytes(true))), $primes[$i]->toBytes(true)); |
| 110 | - $OtherPrimeInfo.= pack('Ca*a*', self::ASN1_INTEGER, ASN1::encodeLength(strlen($exponents[$i]->toBytes(true))), $exponents[$i]->toBytes(true)); |
|
| 111 | - $OtherPrimeInfo.= pack('Ca*a*', self::ASN1_INTEGER, ASN1::encodeLength(strlen($coefficients[$i]->toBytes(true))), $coefficients[$i]->toBytes(true)); |
|
| 112 | - $OtherPrimeInfos.= pack('Ca*a*', self::ASN1_SEQUENCE, ASN1::encodeLength(strlen($OtherPrimeInfo)), $OtherPrimeInfo); |
|
| 110 | + $OtherPrimeInfo .= pack('Ca*a*', self::ASN1_INTEGER, ASN1::encodeLength(strlen($exponents[$i]->toBytes(true))), $exponents[$i]->toBytes(true)); |
|
| 111 | + $OtherPrimeInfo .= pack('Ca*a*', self::ASN1_INTEGER, ASN1::encodeLength(strlen($coefficients[$i]->toBytes(true))), $coefficients[$i]->toBytes(true)); |
|
| 112 | + $OtherPrimeInfos .= pack('Ca*a*', self::ASN1_SEQUENCE, ASN1::encodeLength(strlen($OtherPrimeInfo)), $OtherPrimeInfo); |
|
| 113 | 113 | } |
| 114 | - $RSAPrivateKey.= pack('Ca*a*', self::ASN1_SEQUENCE, ASN1::encodeLength(strlen($OtherPrimeInfos)), $OtherPrimeInfos); |
|
| 114 | + $RSAPrivateKey .= pack('Ca*a*', self::ASN1_SEQUENCE, ASN1::encodeLength(strlen($OtherPrimeInfos)), $OtherPrimeInfos); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, ASN1::encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey); |
@@ -122,15 +122,15 @@ discard block |
||
| 122 | 122 | $cipher->setKey(self::generateSymmetricKey($password, $iv, $cipher->getKeyLength() >> 3)); |
| 123 | 123 | $cipher->setIV($iv); |
| 124 | 124 | $iv = strtoupper(Hex::encode($iv)); |
| 125 | - $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" . |
|
| 126 | - "Proc-Type: 4,ENCRYPTED\r\n" . |
|
| 127 | - "DEK-Info: " . self::$defaultEncryptionAlgorithm . ",$iv\r\n" . |
|
| 128 | - "\r\n" . |
|
| 129 | - chunk_split(Base64::encode($cipher->encrypt($RSAPrivateKey)), 64) . |
|
| 125 | + $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n". |
|
| 126 | + "Proc-Type: 4,ENCRYPTED\r\n". |
|
| 127 | + "DEK-Info: ".self::$defaultEncryptionAlgorithm.",$iv\r\n". |
|
| 128 | + "\r\n". |
|
| 129 | + chunk_split(Base64::encode($cipher->encrypt($RSAPrivateKey)), 64). |
|
| 130 | 130 | '-----END RSA PRIVATE KEY-----'; |
| 131 | 131 | } else { |
| 132 | - $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" . |
|
| 133 | - chunk_split(Base64::encode($RSAPrivateKey), 64) . |
|
| 132 | + $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n". |
|
| 133 | + chunk_split(Base64::encode($RSAPrivateKey), 64). |
|
| 134 | 134 | '-----END RSA PRIVATE KEY-----'; |
| 135 | 135 | } |
| 136 | 136 | |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | $components['publicExponent'] |
| 169 | 169 | ); |
| 170 | 170 | |
| 171 | - $RSAPublicKey = "-----BEGIN RSA PUBLIC KEY-----\r\n" . |
|
| 172 | - chunk_split(Base64::encode($RSAPublicKey), 64) . |
|
| 171 | + $RSAPublicKey = "-----BEGIN RSA PUBLIC KEY-----\r\n". |
|
| 172 | + chunk_split(Base64::encode($RSAPublicKey), 64). |
|
| 173 | 173 | '-----END RSA PUBLIC KEY-----'; |
| 174 | 174 | |
| 175 | 175 | return $RSAPublicKey; |
@@ -48,7 +48,6 @@ |
||
| 48 | 48 | |
| 49 | 49 | namespace phpseclib\Net; |
| 50 | 50 | |
| 51 | -use ParagonIE\ConstantTime\Hex; |
|
| 52 | 51 | use phpseclib\Crypt\DES; |
| 53 | 52 | use phpseclib\Crypt\Random; |
| 54 | 53 | use phpseclib\Crypt\TripleDES; |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | |
| 555 | 555 | if (defined('NET_SSH1_LOGGING')) { |
| 556 | 556 | $this->_append_log('<-', $this->server_identification); |
| 557 | - $this->_append_log('->', $this->identifier . "\r\n"); |
|
| 557 | + $this->_append_log('->', $this->identifier."\r\n"); |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | if (!preg_match('#SSH-([0-9\.]+)-(.+)#', $init_line, $parts)) { |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | } |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | - $session_id = md5($host_key_public_modulus->toBytes() . $server_key_public_modulus->toBytes() . $anti_spoofing_cookie, true); |
|
| 614 | + $session_id = md5($host_key_public_modulus->toBytes().$server_key_public_modulus->toBytes().$anti_spoofing_cookie, true); |
|
| 615 | 615 | |
| 616 | 616 | $session_key = Random::string(32); |
| 617 | 617 | $double_encrypted_session_key = $session_key ^ str_pad($session_id, 32, chr(0)); |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | $this->crypto = new DES(DES::MODE_CBC); |
| 664 | 664 | $this->crypto->disablePadding(); |
| 665 | 665 | $this->crypto->enableContinuousBuffer(); |
| 666 | - $this->crypto->setKey(substr($session_key, 0, 8)); |
|
| 666 | + $this->crypto->setKey(substr($session_key, 0, 8)); |
|
| 667 | 667 | // "The iv (initialization vector) is initialized to all zeroes." |
| 668 | 668 | $this->crypto->setIV(str_repeat("\0", 8)); |
| 669 | 669 | break; |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | |
| 817 | 817 | if ($response !== false) { |
| 818 | 818 | do { |
| 819 | - $output.= substr($response[self::RESPONSE_DATA], 4); |
|
| 819 | + $output .= substr($response[self::RESPONSE_DATA], 4); |
|
| 820 | 820 | $response = $this->_get_binary_packet(); |
| 821 | 821 | } while (is_array($response) && $response[self::RESPONSE_TYPE] != NET_SSH1_SMSG_EXITSTATUS); |
| 822 | 822 | } |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | if ($response === true) { |
| 929 | 929 | return Strings::shift($this->interactiveBuffer, strlen($this->interactiveBuffer)); |
| 930 | 930 | } |
| 931 | - $this->interactiveBuffer.= substr($response[self::RESPONSE_DATA], 4); |
|
| 931 | + $this->interactiveBuffer .= substr($response[self::RESPONSE_DATA], 4); |
|
| 932 | 932 | } |
| 933 | 933 | } |
| 934 | 934 | |
@@ -1081,7 +1081,7 @@ discard block |
||
| 1081 | 1081 | return true; |
| 1082 | 1082 | } |
| 1083 | 1083 | $elapsed = strtok(microtime(), ' ') + strtok('') - $start; |
| 1084 | - $this->curTimeout-= $elapsed; |
|
| 1084 | + $this->curTimeout -= $elapsed; |
|
| 1085 | 1085 | } |
| 1086 | 1086 | |
| 1087 | 1087 | $start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838 |
@@ -1093,8 +1093,8 @@ discard block |
||
| 1093 | 1093 | |
| 1094 | 1094 | while ($length > 0) { |
| 1095 | 1095 | $temp = fread($this->fsock, $length); |
| 1096 | - $raw.= $temp; |
|
| 1097 | - $length-= strlen($temp); |
|
| 1096 | + $raw .= $temp; |
|
| 1097 | + $length -= strlen($temp); |
|
| 1098 | 1098 | } |
| 1099 | 1099 | $stop = strtok(microtime(), ' ') + strtok(''); |
| 1100 | 1100 | |
@@ -1117,8 +1117,8 @@ discard block |
||
| 1117 | 1117 | |
| 1118 | 1118 | if (defined('NET_SSH1_LOGGING')) { |
| 1119 | 1119 | $temp = isset($this->protocol_flags[$type]) ? $this->protocol_flags[$type] : 'UNKNOWN'; |
| 1120 | - $temp = '<- ' . $temp . |
|
| 1121 | - ' (' . round($stop - $start, 4) . 's)'; |
|
| 1120 | + $temp = '<- '.$temp. |
|
| 1121 | + ' ('.round($stop - $start, 4).'s)'; |
|
| 1122 | 1122 | $this->_append_log($temp, $data); |
| 1123 | 1123 | } |
| 1124 | 1124 | |
@@ -1150,8 +1150,8 @@ discard block |
||
| 1150 | 1150 | $padding = Random::string(8 - ($length & 7)); |
| 1151 | 1151 | |
| 1152 | 1152 | $orig = $data; |
| 1153 | - $data = $padding . $data; |
|
| 1154 | - $data.= pack('N', $this->_crc($data)); |
|
| 1153 | + $data = $padding.$data; |
|
| 1154 | + $data .= pack('N', $this->_crc($data)); |
|
| 1155 | 1155 | |
| 1156 | 1156 | if ($this->crypto !== false) { |
| 1157 | 1157 | $data = $this->crypto->encrypt($data); |
@@ -1165,8 +1165,8 @@ discard block |
||
| 1165 | 1165 | |
| 1166 | 1166 | if (defined('NET_SSH1_LOGGING')) { |
| 1167 | 1167 | $temp = isset($this->protocol_flags[ord($orig[0])]) ? $this->protocol_flags[ord($orig[0])] : 'UNKNOWN'; |
| 1168 | - $temp = '-> ' . $temp . |
|
| 1169 | - ' (' . round($stop - $start, 4) . 's)'; |
|
| 1168 | + $temp = '-> '.$temp. |
|
| 1169 | + ' ('.round($stop - $start, 4).'s)'; |
|
| 1170 | 1170 | $this->_append_log($temp, $orig); |
| 1171 | 1171 | } |
| 1172 | 1172 | |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | $crc = 0x00000000; |
| 1261 | 1261 | $length = strlen($data); |
| 1262 | 1262 | |
| 1263 | - for ($i=0; $i<$length; $i++) { |
|
| 1263 | + for ($i = 0; $i < $length; $i++) { |
|
| 1264 | 1264 | // We AND $crc >> 8 with 0x00FFFFFF because we want the eight newly added bits to all |
| 1265 | 1265 | // be zero. PHP, unfortunately, doesn't always do this. 0x80000000 >> 8, as an example, |
| 1266 | 1266 | // yields 0xFF800000 - not 0x00800000. The following link elaborates: |
@@ -1314,9 +1314,9 @@ discard block |
||
| 1314 | 1314 | while (strlen($random) != $length) { |
| 1315 | 1315 | $block = Random::string($length - strlen($random)); |
| 1316 | 1316 | $block = str_replace("\x00", '', $block); |
| 1317 | - $random.= $block; |
|
| 1317 | + $random .= $block; |
|
| 1318 | 1318 | } |
| 1319 | - $temp = chr(0) . chr(2) . $random . chr(0) . $m; |
|
| 1319 | + $temp = chr(0).chr(2).$random.chr(0).$m; |
|
| 1320 | 1320 | |
| 1321 | 1321 | $m = new BigInteger($temp, 256); |
| 1322 | 1322 | $m = $m->modPow($key[0], $key[1]); |
@@ -1386,12 +1386,12 @@ discard block |
||
| 1386 | 1386 | { |
| 1387 | 1387 | $output = ''; |
| 1388 | 1388 | for ($i = 0; $i < count($message_log); $i++) { |
| 1389 | - $output.= $message_number_log[$i] . "\r\n"; |
|
| 1389 | + $output .= $message_number_log[$i]."\r\n"; |
|
| 1390 | 1390 | $current_log = $message_log[$i]; |
| 1391 | 1391 | $j = 0; |
| 1392 | 1392 | do { |
| 1393 | 1393 | if (strlen($current_log)) { |
| 1394 | - $output.= str_pad(dechex($j), 7, '0', STR_PAD_LEFT) . '0 '; |
|
| 1394 | + $output .= str_pad(dechex($j), 7, '0', STR_PAD_LEFT).'0 '; |
|
| 1395 | 1395 | } |
| 1396 | 1396 | $fragment = Strings::shift($current_log, $this->log_short_width); |
| 1397 | 1397 | $hex = substr(preg_replace_callback('#.#s', array($this, '_format_log_helper'), $fragment), strlen($this->log_boundary)); |
@@ -1399,10 +1399,10 @@ discard block |
||
| 1399 | 1399 | // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters |
| 1400 | 1400 | // also replace < with a . since < messes up the output on web browsers |
| 1401 | 1401 | $raw = preg_replace('#[^\x20-\x7E]|<#', '.', $fragment); |
| 1402 | - $output.= str_pad($hex, $this->log_long_width - $this->log_short_width, ' ') . $raw . "\r\n"; |
|
| 1402 | + $output .= str_pad($hex, $this->log_long_width - $this->log_short_width, ' ').$raw."\r\n"; |
|
| 1403 | 1403 | $j++; |
| 1404 | 1404 | } while (strlen($current_log)); |
| 1405 | - $output.= "\r\n"; |
|
| 1405 | + $output .= "\r\n"; |
|
| 1406 | 1406 | } |
| 1407 | 1407 | |
| 1408 | 1408 | return $output; |
@@ -1419,7 +1419,7 @@ discard block |
||
| 1419 | 1419 | */ |
| 1420 | 1420 | function _format_log_helper($matches) |
| 1421 | 1421 | { |
| 1422 | - return $this->log_boundary . str_pad(dechex(ord($matches[0])), 2, '0', STR_PAD_LEFT); |
|
| 1422 | + return $this->log_boundary.str_pad(dechex(ord($matches[0])), 2, '0', STR_PAD_LEFT); |
|
| 1423 | 1423 | } |
| 1424 | 1424 | |
| 1425 | 1425 | /** |
@@ -1544,10 +1544,10 @@ discard block |
||
| 1544 | 1544 | case self::LOG_COMPLEX: |
| 1545 | 1545 | $this->protocol_flags_log[] = $protocol_flags; |
| 1546 | 1546 | Strings::shift($message); |
| 1547 | - $this->log_size+= strlen($message); |
|
| 1547 | + $this->log_size += strlen($message); |
|
| 1548 | 1548 | $this->message_log[] = $message; |
| 1549 | 1549 | while ($this->log_size > self::LOG_MAX_SIZE) { |
| 1550 | - $this->log_size-= strlen(array_shift($this->message_log)); |
|
| 1550 | + $this->log_size -= strlen(array_shift($this->message_log)); |
|
| 1551 | 1551 | array_shift($this->protocol_flags_log); |
| 1552 | 1552 | } |
| 1553 | 1553 | break; |
@@ -1555,7 +1555,7 @@ discard block |
||
| 1555 | 1555 | // passwords won't be filtered out and select other packets may not be correctly |
| 1556 | 1556 | // identified |
| 1557 | 1557 | case self::LOG_REALTIME: |
| 1558 | - echo "<pre>\r\n" . $this->_format_log(array($message), array($protocol_flags)) . "\r\n</pre>\r\n"; |
|
| 1558 | + echo "<pre>\r\n".$this->_format_log(array($message), array($protocol_flags))."\r\n</pre>\r\n"; |
|
| 1559 | 1559 | @flush(); |
| 1560 | 1560 | @ob_flush(); |
| 1561 | 1561 | break; |
@@ -1576,10 +1576,10 @@ discard block |
||
| 1576 | 1576 | $entry = $this->_format_log(array($message), array($protocol_flags)); |
| 1577 | 1577 | if ($this->realtime_log_wrap) { |
| 1578 | 1578 | $temp = "<<< START >>>\r\n"; |
| 1579 | - $entry.= $temp; |
|
| 1579 | + $entry .= $temp; |
|
| 1580 | 1580 | fseek($this->realtime_log_file, ftell($this->realtime_log_file) - strlen($temp)); |
| 1581 | 1581 | } |
| 1582 | - $this->realtime_log_size+= strlen($entry); |
|
| 1582 | + $this->realtime_log_size += strlen($entry); |
|
| 1583 | 1583 | if ($this->realtime_log_size > self::LOG_MAX_SIZE) { |
| 1584 | 1584 | fseek($this->realtime_log_file, 0); |
| 1585 | 1585 | $this->realtime_log_size = strlen($entry); |
@@ -79,7 +79,6 @@ |
||
| 79 | 79 | // phpcrypt |
| 80 | 80 | require_once $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/phpcrypt/phpCrypt.php'; |
| 81 | 81 | use PHP_Crypt\PHP_Crypt as PHP_Crypt; |
| 82 | -use PHP_Crypt\Cipher as Cipher; |
|
| 83 | 82 | |
| 84 | 83 | // prepare Encryption class calls |
| 85 | 84 | use \Defuse\Crypto\Crypto; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $aes->register(); |
| 78 | 78 | |
| 79 | 79 | // phpcrypt |
| 80 | -require_once $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/phpcrypt/phpCrypt.php'; |
|
| 80 | +require_once $_SESSION['settings']['cpassman_dir'].'/includes/libraries/phpcrypt/phpCrypt.php'; |
|
| 81 | 81 | use PHP_Crypt\PHP_Crypt as PHP_Crypt; |
| 82 | 82 | use PHP_Crypt\Cipher as Cipher; |
| 83 | 83 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | if (isset($_SESSION['settings']['item_extra_fields']) && $_SESSION['settings']['item_extra_fields'] == 1) { |
| 217 | 217 | foreach (explode("_|_", $dataReceived['fields']) as $field) { |
| 218 | 218 | $field_data = explode("~~", $field); |
| 219 | - if (count($field_data)>1 && !empty($field_data[1])) { |
|
| 219 | + if (count($field_data) > 1 && !empty($field_data[1])) { |
|
| 220 | 220 | // should we encrypt the data |
| 221 | 221 | $dataTmp = DB::queryFirstRow("SELECT encrypted_data |
| 222 | 222 | FROM ".prefix_table("categories")." |
@@ -344,8 +344,8 @@ discard block |
||
| 344 | 344 | $html = '<li class="item_draggable' |
| 345 | 345 | .'" id="'.$newID.'" style="margin-left:-30px;">' |
| 346 | 346 | .'<span style="cursor:hand;" class="grippy"><i class="fa fa-sm fa-arrows mi-grey-1"></i> </span>' |
| 347 | - .$expirationFlag.'<i class="fa fa-sm fa-warning mi-yellow"></i> ' . |
|
| 348 | - ' <a id="fileclass'.$newID.'" class="file" onclick="AfficherDetailsItem(\''.$newID.'\', \'0\', \'\', \'\', \'\', \'\', \'\')" ondblclick="AfficherDetailsItem(\''.$newID.'\', \'0\', \'\', \'\', \'\', true, \'\')">' . |
|
| 347 | + .$expirationFlag.'<i class="fa fa-sm fa-warning mi-yellow"></i> '. |
|
| 348 | + ' <a id="fileclass'.$newID.'" class="file" onclick="AfficherDetailsItem(\''.$newID.'\', \'0\', \'\', \'\', \'\', \'\', \'\')" ondblclick="AfficherDetailsItem(\''.$newID.'\', \'0\', \'\', \'\', \'\', true, \'\')">'. |
|
| 349 | 349 | stripslashes($dataReceived['label']); |
| 350 | 350 | if (!empty($dataReceived['description']) && isset($_SESSION['settings']['show_description']) && $_SESSION['settings']['show_description'] == 1) { |
| 351 | 351 | $html .= ' <font size=2px>['.strip_tags(stripslashes(substr(cleanString($dataReceived['description']), 0, 30))).']</font>'; |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | if (isset($_SESSION['settings']['item_extra_fields']) && $_SESSION['settings']['item_extra_fields'] == 1) { |
| 572 | 572 | foreach (explode("_|_", $dataReceived['fields']) as $field) { |
| 573 | 573 | $field_data = explode("~~", $field); |
| 574 | - if (count($field_data)>1 && !empty($field_data[1])) { |
|
| 574 | + if (count($field_data) > 1 && !empty($field_data[1])) { |
|
| 575 | 575 | $dataTmpCat = DB::queryFirstRow( |
| 576 | 576 | "SELECT c.title AS title, i.data AS data, i.data_iv AS data_iv, i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data |
| 577 | 577 | FROM ".prefix_table("categories_items")." AS i |
@@ -856,12 +856,12 @@ discard block |
||
| 856 | 856 | foreach ($rows as $record) { |
| 857 | 857 | $reason = explode(':', $record['raison']); |
| 858 | 858 | if (empty($history)) { |
| 859 | - $history = date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date'])." - ".$record['login']." - ".$LANG[$record['action']] . |
|
| 860 | - " - ".(!empty($record['raison']) ? (count($reason) > 1 ? $LANG[trim($reason[0])].' : '.$reason[1] : $LANG[trim($reason[0])]):''); |
|
| 859 | + $history = date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date'])." - ".$record['login']." - ".$LANG[$record['action']]. |
|
| 860 | + " - ".(!empty($record['raison']) ? (count($reason) > 1 ? $LANG[trim($reason[0])].' : '.$reason[1] : $LANG[trim($reason[0])]) : ''); |
|
| 861 | 861 | } else { |
| 862 | - $history .= "<br />".date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date'])." - " . |
|
| 863 | - $record['login']." - ".$LANG[$record['action']]." - " . |
|
| 864 | - (!empty($record['raison']) ? (count($reason) > 1 ? $LANG[trim($reason[0])].' => '.$reason[1] : ($record['action'] != "at_manual" ? $LANG[trim($reason[0])] : trim($reason[0]))):''); |
|
| 862 | + $history .= "<br />".date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date'])." - ". |
|
| 863 | + $record['login']." - ".$LANG[$record['action']]." - ". |
|
| 864 | + (!empty($record['raison']) ? (count($reason) > 1 ? $LANG[trim($reason[0])].' => '.$reason[1] : ($record['action'] != "at_manual" ? $LANG[trim($reason[0])] : trim($reason[0]))) : ''); |
|
| 865 | 865 | } |
| 866 | 866 | } |
| 867 | 867 | // decrypt PW |
@@ -960,9 +960,9 @@ discard block |
||
| 960 | 960 | |
| 961 | 961 | // Prepare some stuff to return |
| 962 | 962 | $arrData = array( |
| 963 | - "files" => $files,//str_replace('"', '"', $files), |
|
| 963 | + "files" => $files, //str_replace('"', '"', $files), |
|
| 964 | 964 | "history" => str_replace('"', '"', $history), |
| 965 | - "files_edit" => $filesEdit,//str_replace('"', '"', $filesEdit), |
|
| 965 | + "files_edit" => $filesEdit, //str_replace('"', '"', $filesEdit), |
|
| 966 | 966 | "id_tree" => $dataItem['id_tree'], |
| 967 | 967 | "id" => $dataItem['id'], |
| 968 | 968 | "reload_page" => $reloadPage, |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | // previous is public folder and personal one |
| 1042 | 1042 | else if ($originalRecord['perso'] === "0" && $dataDestination['personal_folder'] === "1") { |
| 1043 | 1043 | // check if PSK is set |
| 1044 | - if (!isset($_SESSION['user_settings']['session_psk']) || empty($_SESSION['user_settings']['session_psk'])){ |
|
| 1044 | + if (!isset($_SESSION['user_settings']['session_psk']) || empty($_SESSION['user_settings']['session_psk'])) { |
|
| 1045 | 1045 | $returnValues = '[{"error" : "no_psk"}, {"error_text" : "'.addslashes($LANG['alert_message_personal_sk_missing']).'"}]'; |
| 1046 | 1046 | echo $returnValues; |
| 1047 | 1047 | break; |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | } else if ($originalRecord['perso'] === "1" && $dataDestination['personal_folder'] === "1") { |
| 1068 | 1068 | // previous is public folder and personal one |
| 1069 | 1069 | // check if PSK is set |
| 1070 | - if (!isset($_SESSION['user_settings']['session_psk']) || empty($_SESSION['user_settings']['session_psk'])){ |
|
| 1070 | + if (!isset($_SESSION['user_settings']['session_psk']) || empty($_SESSION['user_settings']['session_psk'])) { |
|
| 1071 | 1071 | $returnValues = '[{"error" : "no_psk"}, {"error_text" : "'.addslashes($LANG['alert_message_personal_sk_missing']).'"}]'; |
| 1072 | 1072 | echo $returnValues; |
| 1073 | 1073 | break; |
@@ -1471,12 +1471,12 @@ discard block |
||
| 1471 | 1471 | DB::update( |
| 1472 | 1472 | prefix_table("items"), |
| 1473 | 1473 | array( |
| 1474 | - 'viewed_no' => $dataItem['viewed_no']+1, |
|
| 1474 | + 'viewed_no' => $dataItem['viewed_no'] + 1, |
|
| 1475 | 1475 | ), |
| 1476 | 1476 | "id = %i", |
| 1477 | 1477 | $_POST['id'] |
| 1478 | 1478 | ); |
| 1479 | - $arrData['viewed_no'] = $dataItem['viewed_no']+1; |
|
| 1479 | + $arrData['viewed_no'] = $dataItem['viewed_no'] + 1; |
|
| 1480 | 1480 | |
| 1481 | 1481 | // get fields |
| 1482 | 1482 | $fieldsTmp = $arrCatList = ""; |
@@ -1821,7 +1821,7 @@ discard block |
||
| 1821 | 1821 | } |
| 1822 | 1822 | // check that title is not numeric |
| 1823 | 1823 | if (is_numeric($title) === true) { |
| 1824 | - echo '[{"error" : "ERR_TITLE_ONLY_WITH_NUMBERS"}]';; |
|
| 1824 | + echo '[{"error" : "ERR_TITLE_ONLY_WITH_NUMBERS"}]'; ; |
|
| 1825 | 1825 | break; |
| 1826 | 1826 | } |
| 1827 | 1827 | |
@@ -1864,7 +1864,7 @@ discard block |
||
| 1864 | 1864 | "SELECT title, parent_id, personal_folder FROM ".prefix_table("nested_tree")." WHERE id = %i", |
| 1865 | 1865 | $dataReceived['folder'] |
| 1866 | 1866 | ); |
| 1867 | - if ( $tmp['parent_id'] != 0 || $tmp['title'] != $_SESSION['user_id'] || $tmp['personal_folder'] != 1 ) { |
|
| 1867 | + if ($tmp['parent_id'] != 0 || $tmp['title'] != $_SESSION['user_id'] || $tmp['personal_folder'] != 1) { |
|
| 1868 | 1868 | DB::update( |
| 1869 | 1869 | prefix_table("nested_tree"), |
| 1870 | 1870 | array( |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | break; |
| 1943 | 1943 | }*/ |
| 1944 | 1944 | |
| 1945 | - if ( $tmp_source['parent_id'] != 0 || $tmp_source['title'] != $_SESSION['user_id'] || $tmp_source['personal_folder'] != 1 || $tmp_target['title'] != $_SESSION['user_id'] || $tmp_target['personal_folder'] != 1) { |
|
| 1945 | + if ($tmp_source['parent_id'] != 0 || $tmp_source['title'] != $_SESSION['user_id'] || $tmp_source['personal_folder'] != 1 || $tmp_target['title'] != $_SESSION['user_id'] || $tmp_target['personal_folder'] != 1) { |
|
| 1946 | 1946 | |
| 1947 | 1947 | // moving SOURCE folder |
| 1948 | 1948 | DB::update( |
@@ -2010,7 +2010,7 @@ discard block |
||
| 2010 | 2010 | if (in_array($elem->id, $_SESSION['groupes_visibles'])) { |
| 2011 | 2011 | $arboHtml_tmp .= ' style="cursor:pointer;" onclick="ListerItems('.$elem->id.', \'\', 0)"'; |
| 2012 | 2012 | } |
| 2013 | - $arboHtml_tmp .= '>'. htmlspecialchars(stripslashes($elem->title), ENT_QUOTES). '</a>'; |
|
| 2013 | + $arboHtml_tmp .= '>'.htmlspecialchars(stripslashes($elem->title), ENT_QUOTES).'</a>'; |
|
| 2014 | 2014 | if (empty($arboHtml)) { |
| 2015 | 2015 | $arboHtml = $arboHtml_tmp; |
| 2016 | 2016 | } else { |
@@ -2109,12 +2109,12 @@ discard block |
||
| 2109 | 2109 | INNER JOIN ".prefix_table("log_items")." AS l ON (i.id = l.id_item) |
| 2110 | 2110 | WHERE %l |
| 2111 | 2111 | GROUP BY i.id, l.date, l.id_user, l.action |
| 2112 | - ORDER BY i.label ASC, l.date DESC".$query_limit,// |
|
| 2112 | + ORDER BY i.label ASC, l.date DESC".$query_limit, // |
|
| 2113 | 2113 | $where |
| 2114 | 2114 | ); |
| 2115 | 2115 | } else { |
| 2116 | 2116 | $items_to_display_once = "max"; |
| 2117 | - $where->add('i.inactif=%i',0); |
|
| 2117 | + $where->add('i.inactif=%i', 0); |
|
| 2118 | 2118 | |
| 2119 | 2119 | $rows = DB::query( |
| 2120 | 2120 | "SELECT i.id AS id, MIN(i.restricted_to) AS restricted_to, MIN(i.perso) AS perso, |
@@ -2396,7 +2396,7 @@ discard block |
||
| 2396 | 2396 | // Build array with items |
| 2397 | 2397 | array_push($itemsIDList, array($record['id'], $pw, $record['login'], $displayItem)); |
| 2398 | 2398 | |
| 2399 | - $i ++; |
|
| 2399 | + $i++; |
|
| 2400 | 2400 | } |
| 2401 | 2401 | $idManaged = $record['id']; |
| 2402 | 2402 | } |
@@ -2524,12 +2524,12 @@ discard block |
||
| 2524 | 2524 | |
| 2525 | 2525 | if (isset($_POST['item_id']) && !empty($_POST['item_id'])) { |
| 2526 | 2526 | // Lock Item (if already locked), go back and warn |
| 2527 | - $dataTmp = DB::queryFirstRow("SELECT timestamp, user_id FROM ".prefix_table("items_edition")." WHERE item_id = %i", $_POST['item_id']);//echo ">".$dataTmp[0]; |
|
| 2527 | + $dataTmp = DB::queryFirstRow("SELECT timestamp, user_id FROM ".prefix_table("items_edition")." WHERE item_id = %i", $_POST['item_id']); //echo ">".$dataTmp[0]; |
|
| 2528 | 2528 | |
| 2529 | 2529 | // If token is taken for this Item and delay is passed then delete it. |
| 2530 | 2530 | if (isset($_SESSION['settings']['delay_item_edition']) && |
| 2531 | 2531 | $_SESSION['settings']['delay_item_edition'] > 0 && !empty($dataTmp['timestamp']) && |
| 2532 | - round(abs(time()-$dataTmp['timestamp']) / 60, 2) > $_SESSION['settings']['delay_item_edition'] |
|
| 2532 | + round(abs(time() - $dataTmp['timestamp']) / 60, 2) > $_SESSION['settings']['delay_item_edition'] |
|
| 2533 | 2533 | ) { |
| 2534 | 2534 | DB::delete(prefix_table("items_edition"), "item_id = %i", $_POST['item_id']); |
| 2535 | 2535 | //reload the previous data |
@@ -2705,7 +2705,7 @@ discard block |
||
| 2705 | 2705 | // Delete from FILES table |
| 2706 | 2706 | DB::delete(prefix_table("files"), "id = %i", $_POST['file_id']); |
| 2707 | 2707 | // Update the log |
| 2708 | - logItems($data['id_item'], $dataItem['label'], $_SESSION['user_id'], 'at_modification', $_SESSION['login'],'at_del_file : '.$data['name']); |
|
| 2708 | + logItems($data['id_item'], $dataItem['label'], $_SESSION['user_id'], 'at_modification', $_SESSION['login'], 'at_del_file : '.$data['name']); |
|
| 2709 | 2709 | // Delete file from server |
| 2710 | 2710 | @unlink($_SESSION['settings']['path_to_upload_folder']."/".$data['file']); |
| 2711 | 2711 | } |
@@ -2745,7 +2745,7 @@ discard block |
||
| 2745 | 2745 | "SELECT description FROM ".prefix_table("items")." WHERE id=%i", $_POST['id_item'] |
| 2746 | 2746 | ); |
| 2747 | 2747 | // Clean up the string |
| 2748 | - echo json_encode(array("description" => strip_tags($dataItem['description'])), JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP); |
|
| 2748 | + echo json_encode(array("description" => strip_tags($dataItem['description'])), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); |
|
| 2749 | 2749 | break; |
| 2750 | 2750 | |
| 2751 | 2751 | /* |
@@ -3293,7 +3293,7 @@ discard block |
||
| 3293 | 3293 | $_SESSION['settings']['otv_expiration_period'] = 7; |
| 3294 | 3294 | } |
| 3295 | 3295 | $url = $_SESSION['settings']['cpassman_url']."/index.php?otv=true&".http_build_query($otv_session); |
| 3296 | - $exp_date = date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], time() + (intval($_SESSION['settings']['otv_expiration_period'])*86400)); |
|
| 3296 | + $exp_date = date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], time() + (intval($_SESSION['settings']['otv_expiration_period']) * 86400)); |
|
| 3297 | 3297 | |
| 3298 | 3298 | echo json_encode( |
| 3299 | 3299 | array( |
@@ -3323,7 +3323,7 @@ discard block |
||
| 3323 | 3323 | |
| 3324 | 3324 | // prepare image info |
| 3325 | 3325 | $image_code = $file_info['file']; |
| 3326 | - $extension = substr($_POST['title'], strrpos($_POST['title'], '.')+1); |
|
| 3326 | + $extension = substr($_POST['title'], strrpos($_POST['title'], '.') + 1); |
|
| 3327 | 3327 | $file_to_display = $_SESSION['settings']['url_to_upload_folder'].'/'.$image_code; |
| 3328 | 3328 | $file_suffix = ""; |
| 3329 | 3329 | |
@@ -3610,7 +3610,7 @@ discard block |
||
| 3610 | 3610 | $fldTitle = str_replace("&", "&", $folder->title); |
| 3611 | 3611 | |
| 3612 | 3612 | // rename personal folder with user login |
| 3613 | - if ($folder->title == $_SESSION['user_id'] && $folder->nlevel == 1 ) { |
|
| 3613 | + if ($folder->title == $_SESSION['user_id'] && $folder->nlevel == 1) { |
|
| 3614 | 3614 | $fldTitle = $_SESSION['login']; |
| 3615 | 3615 | } |
| 3616 | 3616 | |
@@ -3738,7 +3738,7 @@ discard block |
||
| 3738 | 3738 | '<td rowspan="2" style="width:40px;"><img src="'.$avatar.'" style="border-radius:20px; height:35px;"></td>'. |
| 3739 | 3739 | '<td colspan="2" style="font-size:11px;"><i>'.$LANG['by'].' '.$record['login'].' '.$LANG['at'].' '.date($_SESSION['settings']['date_format'].' '.$_SESSION['settings']['time_format'], $record['date']).'</i></td></tr>'. |
| 3740 | 3740 | '<tr style="border-bottom:3px solid #C9C9C9;"><td style="width:100px;"><b>'.$LANG[$record['action']].'</b></td>'. |
| 3741 | - '<td style="">' . (!empty($record['raison']) && $record['action'] !== "at_creation" ? (count($reason) > 1 ? $LANG[trim($reason[0])].' : '.handleBackslash($reason[1]) : ($record['action'] == "at_manual" ? $reason[0] : $LANG[trim($reason[0])])) : '') . '</td>'. |
|
| 3741 | + '<td style="">'.(!empty($record['raison']) && $record['action'] !== "at_creation" ? (count($reason) > 1 ? $LANG[trim($reason[0])].' : '.handleBackslash($reason[1]) : ($record['action'] == "at_manual" ? $reason[0] : $LANG[trim($reason[0])])) : '').'</td>'. |
|
| 3742 | 3742 | '</tr>'. |
| 3743 | 3743 | '<tr></tr>'; |
| 3744 | 3744 | } |
@@ -25,7 +25,6 @@ |
||
| 25 | 25 | require_once $_SESSION['settings']['cpassman_dir'] . '/includes/config/settings.php'; |
| 26 | 26 | } |
| 27 | 27 | use PHP_Crypt\PHP_Crypt as PHP_Crypt; |
| 28 | -use PHP_Crypt\Cipher as Cipher; |
|
| 29 | 28 | |
| 30 | 29 | |
| 31 | 30 | // prepare Encryption class calls |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | require_once '../includes/libraries/phpcrypt/phpCrypt.php'; |
| 22 | 22 | require_once '../includes/config/settings.php'; |
| 23 | 23 | } else { |
| 24 | - require_once $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/phpcrypt/phpCrypt.php'; |
|
| 25 | - require_once $_SESSION['settings']['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 24 | + require_once $_SESSION['settings']['cpassman_dir'].'/includes/libraries/phpcrypt/phpCrypt.php'; |
|
| 25 | + require_once $_SESSION['settings']['cpassman_dir'].'/includes/config/settings.php'; |
|
| 26 | 26 | } |
| 27 | 27 | use PHP_Crypt\PHP_Crypt as PHP_Crypt; |
| 28 | 28 | use PHP_Crypt\Cipher as Cipher; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $str = ''; |
| 39 | 39 | $x = $n + 10; |
| 40 | - for ($i=0; $i<$x; $i++) { |
|
| 40 | + for ($i = 0; $i < $x; $i++) { |
|
| 41 | 41 | $str .= base_convert(mt_rand(1, 36), 10, 36); |
| 42 | 42 | } |
| 43 | 43 | return substr($str, 0, $n); |
@@ -46,13 +46,13 @@ discard block |
||
| 46 | 46 | //generate pbkdf2 compliant hash |
| 47 | 47 | function strHashPbkdf2($p, $s, $c, $kl, $a = 'sha256', $st = 0) |
| 48 | 48 | { |
| 49 | - $kb = $st+$kl; // Key blocks to compute |
|
| 50 | - $dk = ''; // Derived key |
|
| 49 | + $kb = $st + $kl; // Key blocks to compute |
|
| 50 | + $dk = ''; // Derived key |
|
| 51 | 51 | |
| 52 | - for ($block=1; $block<=$kb; $block++) { // Create key |
|
| 53 | - $ib = $h = hash_hmac($a, $s . pack('N', $block), $p, true); // Initial hash for this block |
|
| 54 | - for ($i=1; $i<$c; $i++) { // Perform block iterations |
|
| 55 | - $ib ^= ($h = hash_hmac($a, $h, $p, true)); // XOR each iterate |
|
| 52 | + for ($block = 1; $block <= $kb; $block++) { // Create key |
|
| 53 | + $ib = $h = hash_hmac($a, $s.pack('N', $block), $p, true); // Initial hash for this block |
|
| 54 | + for ($i = 1; $i < $c; $i++) { // Perform block iterations |
|
| 55 | + $ib ^= ($h = hash_hmac($a, $h, $p, true)); // XOR each iterate |
|
| 56 | 56 | } |
| 57 | 57 | $dk .= $ib; // Append iterated block |
| 58 | 58 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | if (!isset($_SESSION['settings']['cpassman_dir']) || empty($_SESSION['settings']['cpassman_dir'])) { |
| 156 | 156 | require_once '../includes/libraries/Encryption/PBKDF2/PasswordHash.php'; |
| 157 | 157 | } else { |
| 158 | - require_once $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Encryption/PBKDF2/PasswordHash.php'; |
|
| 158 | + require_once $_SESSION['settings']['cpassman_dir'].'/includes/libraries/Encryption/PBKDF2/PasswordHash.php'; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | if (!empty($personalSalt)) { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $pbkdf2Salt = getBits(64); |
| 170 | 170 | // generate a pbkdf2 key to use for the encryption. |
| 171 | 171 | //$key = strHashPbkdf2($staticSalt, $pbkdf2Salt, ITCOUNT, 16, 'sha256', 32); |
| 172 | - $key = substr(pbkdf2('sha256', $staticSalt, $pbkdf2Salt, ITCOUNT, 16+32, true), 32, 16); |
|
| 172 | + $key = substr(pbkdf2('sha256', $staticSalt, $pbkdf2Salt, ITCOUNT, 16 + 32, true), 32, 16); |
|
| 173 | 173 | // Build $iv and $ivBase64. We use a block size of 256 bits (AES compliant) |
| 174 | 174 | // and CTR mode. (Note: ECB mode is inadequate as IV is not used.) |
| 175 | 175 | $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, 'ctr'), MCRYPT_RAND); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | // MAC the encrypted text |
| 184 | 184 | $mac = hash_hmac('sha256', $encrypted, $staticSalt); |
| 185 | 185 | // We're done! |
| 186 | - return base64_encode($ivBase64 . $encrypted . $mac . $pbkdf2Salt); |
|
| 186 | + return base64_encode($ivBase64.$encrypted.$mac.$pbkdf2Salt); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | if (!isset($_SESSION['settings']['cpassman_dir']) || empty($_SESSION['settings']['cpassman_dir'])) { |
| 197 | 197 | require_once '../includes/libraries/Encryption/PBKDF2/PasswordHash.php'; |
| 198 | 198 | } else { |
| 199 | - require_once $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Encryption/PBKDF2/PasswordHash.php'; |
|
| 199 | + require_once $_SESSION['settings']['cpassman_dir'].'/includes/libraries/Encryption/PBKDF2/PasswordHash.php'; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | if (!empty($personalSalt)) { |
@@ -211,9 +211,9 @@ discard block |
||
| 211 | 211 | //remove the salt from the string |
| 212 | 212 | $encrypted = substr($encrypted, 0, -64); |
| 213 | 213 | //$key = strHashPbkdf2($staticSalt, $pbkdf2Salt, ITCOUNT, 16, 'sha256', 32); |
| 214 | - $key = substr(pbkdf2('sha256', $staticSalt, $pbkdf2Salt, ITCOUNT, 16+32, true), 32, 16); |
|
| 214 | + $key = substr(pbkdf2('sha256', $staticSalt, $pbkdf2Salt, ITCOUNT, 16 + 32, true), 32, 16); |
|
| 215 | 215 | // Retrieve $iv which is the first 22 characters plus ==, base64_decoded. |
| 216 | - $iv = base64_decode(substr($encrypted, 0, 43) . '=='); |
|
| 216 | + $iv = base64_decode(substr($encrypted, 0, 43).'=='); |
|
| 217 | 217 | // Remove $iv from $encrypted. |
| 218 | 218 | $encrypted = substr($encrypted, 43); |
| 219 | 219 | // Retrieve $mac which is the last 64 characters of $encrypted. |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | if (function_exists('openssl_random_pseudo_bytes')) { |
| 243 | 243 | $salt .= bin2hex(openssl_random_pseudo_bytes(11)); |
| 244 | 244 | } else { |
| 245 | - $chars='./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; |
|
| 246 | - for ($i=0; $i<22; $i++) { |
|
| 247 | - $salt.=$chars[mt_rand(0, 63)]; |
|
| 245 | + $chars = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; |
|
| 246 | + for ($i = 0; $i < 22; $i++) { |
|
| 247 | + $salt .= $chars[mt_rand(0, 63)]; |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | return crypt($password, $salt); |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | } |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | -function testHex2Bin ($val) |
|
| 344 | +function testHex2Bin($val) |
|
| 345 | 345 | { |
| 346 | 346 | if (!@hex2bin($val)) { |
| 347 | 347 | throw new Exception("ERROR"); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | if (!isset($_SESSION['settings']['cpassman_dir']) || empty($_SESSION['settings']['cpassman_dir'])) { |
| 356 | 356 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 357 | 357 | } else { |
| 358 | - $path = $_SESSION['settings']['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/'; |
|
| 358 | + $path = $_SESSION['settings']['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'; |
|
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | require_once $path.'Crypto.php'; |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk); |
| 437 | 437 | $protected_key_encoded = $protected_key->saveToAsciiSafeString(); |
| 438 | 438 | |
| 439 | - return $protected_key_encoded; // save this in user table |
|
| 439 | + return $protected_key_encoded; // save this in user table |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | function defuse_validate_personal_key($psk, $protected_key_encoded) { |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | return "Error - The saltkey is not the correct one."; |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | - return $user_key_encoded; // store it in session once user has entered his psk |
|
| 465 | + return $user_key_encoded; // store it in session once user has entered his psk |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | /** |
@@ -505,8 +505,8 @@ discard block |
||
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | function db_error_handler($params) { |
| 508 | - echo "Error: " . $params['error'] . "<br>\n"; |
|
| 509 | - echo "Query: " . $params['query'] . "<br>\n"; |
|
| 508 | + echo "Error: ".$params['error']."<br>\n"; |
|
| 509 | + echo "Query: ".$params['query']."<br>\n"; |
|
| 510 | 510 | die; // don't want to keep going if a query broke |
| 511 | 511 | } |
| 512 | 512 | |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | $tmp = DB::queryfirstrow("SELECT allow_pw_change FROM ".prefix_table("roles_title")." WHERE id = %i", $roleId); |
| 636 | 636 | foreach ($rows as $record) { |
| 637 | 637 | if (isset($record['folder_id']) && !in_array($record['folder_id'], $listAllowedFolders)) { |
| 638 | - array_push($listAllowedFolders, $record['folder_id']);//echo $record['folder_id'].";"; |
|
| 638 | + array_push($listAllowedFolders, $record['folder_id']); //echo $record['folder_id'].";"; |
|
| 639 | 639 | } |
| 640 | 640 | // Check if this group is allowed to modify any pw in allowed folders |
| 641 | 641 | if ($tmp['allow_pw_change'] == 1 && !in_array($record['folder_id'], $listFoldersEditableByRole)) { |
@@ -736,14 +736,14 @@ discard block |
||
| 736 | 736 | // get list of readonly folders when pf is disabled. |
| 737 | 737 | // rule - if one folder is set as W or N in one of the Role, then User has access as W |
| 738 | 738 | foreach ($listAllowedFolders as $folderId) { |
| 739 | - if (!in_array($folderId, array_unique (array_merge ($listReadOnlyFolders, $_SESSION['personal_folders'])))) { // |
|
| 739 | + if (!in_array($folderId, array_unique(array_merge($listReadOnlyFolders, $_SESSION['personal_folders'])))) { // |
|
| 740 | 740 | DB::query( |
| 741 | 741 | "SELECT * |
| 742 | 742 | FROM ".prefix_table("roles_values")." |
| 743 | 743 | WHERE folder_id = %i AND role_id IN %li AND type IN %ls", |
| 744 | 744 | $folderId, |
| 745 | 745 | $fonctionsAssociees, |
| 746 | - array("W","ND","NE","NDNE") |
|
| 746 | + array("W", "ND", "NE", "NDNE") |
|
| 747 | 747 | |
| 748 | 748 | ); |
| 749 | 749 | if (DB::count() == 0 && !in_array($folderId, $groupesVisiblesUser)) { |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | WHERE folder_id = %i AND role_id IN %li AND type IN %ls", |
| 763 | 763 | $folderId, |
| 764 | 764 | $fonctionsAssociees, |
| 765 | - array("W","ND","NE","NDNE") |
|
| 765 | + array("W", "ND", "NE", "NDNE") |
|
| 766 | 766 | ); |
| 767 | 767 | if (DB::count() == 0 && !in_array($folderId, $groupesVisiblesUser)) { |
| 768 | 768 | array_push($listReadOnlyFolders, $folderId); |
@@ -1121,7 +1121,7 @@ discard block |
||
| 1121 | 1121 | global $LANG; |
| 1122 | 1122 | include $_SESSION['settings']['cpassman_dir'].'/includes/config/settings.php'; |
| 1123 | 1123 | //load library |
| 1124 | - $user_language = isset($_SESSION['user_language']) ?$_SESSION['user_language'] : "english"; |
|
| 1124 | + $user_language = isset($_SESSION['user_language']) ? $_SESSION['user_language'] : "english"; |
|
| 1125 | 1125 | require_once $_SESSION['settings']['cpassman_dir'].'/includes/language/'.$user_language.'.php'; |
| 1126 | 1126 | require_once $_SESSION['settings']['cpassman_dir'].'/includes/libraries/Email/Phpmailer/PHPMailerAutoload.php'; |
| 1127 | 1127 | |
@@ -1230,19 +1230,19 @@ discard block |
||
| 1230 | 1230 | ) { |
| 1231 | 1231 | return json_encode( |
| 1232 | 1232 | $data, |
| 1233 | - JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP |
|
| 1233 | + JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP |
|
| 1234 | 1234 | ); |
| 1235 | 1235 | } else { |
| 1236 | 1236 | return Encryption\Crypt\aesctr::encrypt( |
| 1237 | 1237 | json_encode( |
| 1238 | 1238 | $data, |
| 1239 | - JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP |
|
| 1239 | + JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP |
|
| 1240 | 1240 | ), |
| 1241 | 1241 | $_SESSION['key'], |
| 1242 | 1242 | 256 |
| 1243 | 1243 | ); |
| 1244 | 1244 | } |
| 1245 | - } elseif ($type == "decode") { |
|
| 1245 | + } elseif ($type == "decode") { |
|
| 1246 | 1246 | if ( |
| 1247 | 1247 | isset($_SESSION['settings']['encryptClientServer']) |
| 1248 | 1248 | && $_SESSION['settings']['encryptClientServer'] == 0 |
@@ -1303,7 +1303,7 @@ discard block |
||
| 1303 | 1303 | /* |
| 1304 | 1304 | * Creates a KEY using PasswordLib |
| 1305 | 1305 | */ |
| 1306 | -function GenerateCryptKey($size="", $secure="", $numerals="", $capitalize="", $ambiguous="", $symbols="") |
|
| 1306 | +function GenerateCryptKey($size = "", $secure = "", $numerals = "", $capitalize = "", $ambiguous = "", $symbols = "") |
|
| 1307 | 1307 | { |
| 1308 | 1308 | // load library |
| 1309 | 1309 | $pwgen = new SplClassLoader('Encryption\PwGen', '../includes/libraries'); |
@@ -1311,12 +1311,12 @@ discard block |
||
| 1311 | 1311 | $pwgen = new Encryption\PwGen\pwgen(); |
| 1312 | 1312 | |
| 1313 | 1313 | // init |
| 1314 | - if(!empty($size)) $pwgen->setLength($size); |
|
| 1315 | - if(!empty($secure)) $pwgen->setSecure($secure); |
|
| 1316 | - if(!empty($numerals)) $pwgen->setNumerals($numerals); |
|
| 1317 | - if(!empty($capitalize)) $pwgen->setCapitalize($capitalize); |
|
| 1318 | - if(!empty($ambiguous)) $pwgen->setAmbiguous($ambiguous); |
|
| 1319 | - if(!empty($symbols)) $pwgen->setSymbols($symbols); |
|
| 1314 | + if (!empty($size)) $pwgen->setLength($size); |
|
| 1315 | + if (!empty($secure)) $pwgen->setSecure($secure); |
|
| 1316 | + if (!empty($numerals)) $pwgen->setNumerals($numerals); |
|
| 1317 | + if (!empty($capitalize)) $pwgen->setCapitalize($capitalize); |
|
| 1318 | + if (!empty($ambiguous)) $pwgen->setAmbiguous($ambiguous); |
|
| 1319 | + if (!empty($symbols)) $pwgen->setSymbols($symbols); |
|
| 1320 | 1320 | |
| 1321 | 1321 | // generate and send back |
| 1322 | 1322 | return $pwgen->generate(); |
@@ -1325,11 +1325,11 @@ discard block |
||
| 1325 | 1325 | /* |
| 1326 | 1326 | * Send sysLOG message |
| 1327 | 1327 | */ |
| 1328 | -function send_syslog($message, $component = "teampass", $program = "php", $host , $port) |
|
| 1328 | +function send_syslog($message, $component = "teampass", $program = "php", $host, $port) |
|
| 1329 | 1329 | { |
| 1330 | 1330 | $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); |
| 1331 | 1331 | //$syslog_message = "<123>" . date('M d H:i:s ') . " " .$host . " " . $component . ": " . $message; |
| 1332 | - $syslog_message = "<123>" . date('M d H:i:s ') . $component . ": " . $message; |
|
| 1332 | + $syslog_message = "<123>".date('M d H:i:s ').$component.": ".$message; |
|
| 1333 | 1333 | socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port); |
| 1334 | 1334 | socket_close($sock); |
| 1335 | 1335 | } |
@@ -1341,7 +1341,7 @@ discard block |
||
| 1341 | 1341 | * |
| 1342 | 1342 | * permits to log events into DB |
| 1343 | 1343 | */ |
| 1344 | -function logEvents($type, $label, $who, $login="", $field_1 = NULL) |
|
| 1344 | +function logEvents($type, $label, $who, $login = "", $field_1 = NULL) |
|
| 1345 | 1345 | { |
| 1346 | 1346 | global $server, $user, $pass, $database, $pre, $port, $encoding; |
| 1347 | 1347 | |
@@ -1370,10 +1370,10 @@ discard block |
||
| 1370 | 1370 | ) |
| 1371 | 1371 | ); |
| 1372 | 1372 | if (isset($_SESSION['settings']['syslog_enable']) && $_SESSION['settings']['syslog_enable'] == 1) { |
| 1373 | - if ($type == "user_mngt"){ |
|
| 1374 | - send_syslog("The User " .$login. " perform the acction off " .$label. " to the user " .$field_1. " - " .$type,"teampass","php",$_SESSION['settings']['syslog_host'],$_SESSION['settings']['syslog_port']); |
|
| 1373 | + if ($type == "user_mngt") { |
|
| 1374 | + send_syslog("The User ".$login." perform the acction off ".$label." to the user ".$field_1." - ".$type, "teampass", "php", $_SESSION['settings']['syslog_host'], $_SESSION['settings']['syslog_port']); |
|
| 1375 | 1375 | } else { |
| 1376 | - send_syslog("The User " .$login. " perform the acction off " .$label. " - " .$type,"teampass","php",$_SESSION['settings']['syslog_host'],$_SESSION['settings']['syslog_port']); |
|
| 1376 | + send_syslog("The User ".$login." perform the acction off ".$label." - ".$type, "teampass", "php", $_SESSION['settings']['syslog_host'], $_SESSION['settings']['syslog_port']); |
|
| 1377 | 1377 | } |
| 1378 | 1378 | } |
| 1379 | 1379 | } |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | ) |
| 1407 | 1407 | ); |
| 1408 | 1408 | if (isset($_SESSION['settings']['syslog_enable']) && $_SESSION['settings']['syslog_enable'] == 1) { |
| 1409 | - send_syslog("The Item ".$item." was ".$action." by ".$login." ".$raison,"teampass","php",$_SESSION['settings']['syslog_host'],$_SESSION['settings']['syslog_port']); |
|
| 1409 | + send_syslog("The Item ".$item." was ".$action." by ".$login." ".$raison, "teampass", "php", $_SESSION['settings']['syslog_host'], $_SESSION['settings']['syslog_port']); |
|
| 1410 | 1410 | } |
| 1411 | 1411 | } |
| 1412 | 1412 | |
@@ -1417,15 +1417,15 @@ discard block |
||
| 1417 | 1417 | $ipaddress = ''; |
| 1418 | 1418 | if (getenv('HTTP_CLIENT_IP')) |
| 1419 | 1419 | $ipaddress = getenv('HTTP_CLIENT_IP'); |
| 1420 | - else if(getenv('HTTP_X_FORWARDED_FOR')) |
|
| 1420 | + else if (getenv('HTTP_X_FORWARDED_FOR')) |
|
| 1421 | 1421 | $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); |
| 1422 | - else if(getenv('HTTP_X_FORWARDED')) |
|
| 1422 | + else if (getenv('HTTP_X_FORWARDED')) |
|
| 1423 | 1423 | $ipaddress = getenv('HTTP_X_FORWARDED'); |
| 1424 | - else if(getenv('HTTP_FORWARDED_FOR')) |
|
| 1424 | + else if (getenv('HTTP_FORWARDED_FOR')) |
|
| 1425 | 1425 | $ipaddress = getenv('HTTP_FORWARDED_FOR'); |
| 1426 | - else if(getenv('HTTP_FORWARDED')) |
|
| 1426 | + else if (getenv('HTTP_FORWARDED')) |
|
| 1427 | 1427 | $ipaddress = getenv('HTTP_FORWARDED'); |
| 1428 | - else if(getenv('REMOTE_ADDR')) |
|
| 1428 | + else if (getenv('REMOTE_ADDR')) |
|
| 1429 | 1429 | $ipaddress = getenv('REMOTE_ADDR'); |
| 1430 | 1430 | else |
| 1431 | 1431 | $ipaddress = 'UNKNOWN'; |
@@ -1472,7 +1472,7 @@ discard block |
||
| 1472 | 1472 | // perform a copy |
| 1473 | 1473 | if (file_exists($tp_config_file)) { |
| 1474 | 1474 | if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d_His", time()))) { |
| 1475 | - return "ERROR: Could not copy file '" . $tp_config_file . "'"; |
|
| 1475 | + return "ERROR: Could not copy file '".$tp_config_file."'"; |
|
| 1476 | 1476 | } |
| 1477 | 1477 | } |
| 1478 | 1478 | |
@@ -1494,7 +1494,7 @@ discard block |
||
| 1494 | 1494 | $data = file($tp_config_file); |
| 1495 | 1495 | $x = 0; |
| 1496 | 1496 | $bFound = false; |
| 1497 | - foreach($data as $line) { |
|
| 1497 | + foreach ($data as $line) { |
|
| 1498 | 1498 | if (stristr($line, ");")) break; |
| 1499 | 1499 | if (stristr($line, "'".$field."' => '")) { |
| 1500 | 1500 | $data[$x] = " '".$field."' => '".$value."',\n"; |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | $x++; |
| 1505 | 1505 | } |
| 1506 | 1506 | if ($bFound === false) { |
| 1507 | - $data[($x-1)] = " '".$field."' => '".$value."',\n"; |
|
| 1507 | + $data[($x - 1)] = " '".$field."' => '".$value."',\n"; |
|
| 1508 | 1508 | } |
| 1509 | 1509 | } else { |
| 1510 | 1510 | // ERROR |
@@ -1519,7 +1519,7 @@ discard block |
||
| 1519 | 1519 | /* |
| 1520 | 1520 | ** Permits to replace \ to permit correct display |
| 1521 | 1521 | */ |
| 1522 | -function handleBackslash ($input) |
|
| 1522 | +function handleBackslash($input) |
|
| 1523 | 1523 | { |
| 1524 | 1524 | return str_replace("&#92;", "\", $input); |
| 1525 | 1525 | } |
@@ -1527,15 +1527,15 @@ discard block |
||
| 1527 | 1527 | /* |
| 1528 | 1528 | ** Permits to loas settings |
| 1529 | 1529 | */ |
| 1530 | -function loadSettings () |
|
| 1530 | +function loadSettings() |
|
| 1531 | 1531 | { |
| 1532 | 1532 | /* LOAD CPASSMAN SETTINGS */ |
| 1533 | 1533 | if (!isset($_SESSION['settings']['loaded']) || $_SESSION['settings']['loaded'] != 1) { |
| 1534 | - $_SESSION['settings']['duplicate_folder'] = 0; //by default, this is false; |
|
| 1535 | - $_SESSION['settings']['duplicate_item'] = 0; //by default, this is false; |
|
| 1534 | + $_SESSION['settings']['duplicate_folder'] = 0; //by default, this is false; |
|
| 1535 | + $_SESSION['settings']['duplicate_item'] = 0; //by default, this is false; |
|
| 1536 | 1536 | $_SESSION['settings']['number_of_used_pw'] = 5; //by default, this value is 5; |
| 1537 | 1537 | |
| 1538 | - $rows = DB::query("SELECT * FROM " . prefix_table("misc") . " WHERE type=%s_type OR type=%s_type2", |
|
| 1538 | + $rows = DB::query("SELECT * FROM ".prefix_table("misc")." WHERE type=%s_type OR type=%s_type2", |
|
| 1539 | 1539 | array( |
| 1540 | 1540 | 'type' => "admin", |
| 1541 | 1541 | 'type2' => "settings" |
@@ -1716,7 +1716,7 @@ discard block |
||
| 1716 | 1716 | unlink($file); |
| 1717 | 1717 | } else { |
| 1718 | 1718 | $lines = array(); |
| 1719 | - exec("DEL /F/Q \"" . $file . "\"", $lines, $deleteError); |
|
| 1719 | + exec("DEL /F/Q \"".$file."\"", $lines, $deleteError); |
|
| 1720 | 1720 | } |
| 1721 | 1721 | } |
| 1722 | 1722 | } |
| 1723 | 1723 | \ No newline at end of file |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | "SELECT id, login FROM ".prefix_table("users")." ORDER BY login ASC" |
| 41 | 41 | ); |
| 42 | 42 | $counter = DB::count(); |
| 43 | -if ($counter>0) { |
|
| 43 | +if ($counter > 0) { |
|
| 44 | 44 | foreach ($rows as $reccord) { |
| 45 | 45 | $tab_users[$reccord['login']] = array( |
| 46 | 46 | 'id'=>$reccord['id'], |
@@ -116,35 +116,35 @@ discard block |
||
| 116 | 116 | $("#offline_password").simplePassMeter({ |
| 117 | 117 | "requirements": {}, |
| 118 | 118 | "container": "#offline_pw_strength", |
| 119 | - "defaultText" : "<?php echo $LANG['index_pw_level_txt'];?>", |
|
| 119 | + "defaultText" : "<?php echo $LANG['index_pw_level_txt']; ?>", |
|
| 120 | 120 | "ratings": [ |
| 121 | 121 | {"minScore": 0, |
| 122 | 122 | "className": "meterFail", |
| 123 | - "text": "<?php echo $LANG['complex_level0'];?>" |
|
| 123 | + "text": "<?php echo $LANG['complex_level0']; ?>" |
|
| 124 | 124 | }, |
| 125 | 125 | {"minScore": 25, |
| 126 | 126 | "className": "meterWarn", |
| 127 | - "text": "<?php echo $LANG['complex_level1'];?>" |
|
| 127 | + "text": "<?php echo $LANG['complex_level1']; ?>" |
|
| 128 | 128 | }, |
| 129 | 129 | {"minScore": 50, |
| 130 | 130 | "className": "meterWarn", |
| 131 | - "text": "<?php echo $LANG['complex_level2'];?>" |
|
| 131 | + "text": "<?php echo $LANG['complex_level2']; ?>" |
|
| 132 | 132 | }, |
| 133 | 133 | {"minScore": 60, |
| 134 | 134 | "className": "meterGood", |
| 135 | - "text": "<?php echo $LANG['complex_level3'];?>" |
|
| 135 | + "text": "<?php echo $LANG['complex_level3']; ?>" |
|
| 136 | 136 | }, |
| 137 | 137 | {"minScore": 70, |
| 138 | 138 | "className": "meterGood", |
| 139 | - "text": "<?php echo $LANG['complex_level4'];?>" |
|
| 139 | + "text": "<?php echo $LANG['complex_level4']; ?>" |
|
| 140 | 140 | }, |
| 141 | 141 | {"minScore": 80, |
| 142 | 142 | "className": "meterExcel", |
| 143 | - "text": "<?php echo $LANG['complex_level5'];?>" |
|
| 143 | + "text": "<?php echo $LANG['complex_level5']; ?>" |
|
| 144 | 144 | }, |
| 145 | 145 | {"minScore": 90, |
| 146 | 146 | "className": "meterExcel", |
| 147 | - "text": "<?php echo $LANG['complex_level6'];?>" |
|
| 147 | + "text": "<?php echo $LANG['complex_level6']; ?>" |
|
| 148 | 148 | } |
| 149 | 149 | ] |
| 150 | 150 | }); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | function generateOfflineFile() |
| 164 | 164 | { |
| 165 | - $("#offline_information").html('<i class="fa fa-cog fa-spin"></i> <?php echo $LANG['please_wait'];?>').attr("class","").show(); |
|
| 165 | + $("#offline_information").html('<i class="fa fa-cog fa-spin"></i> <?php echo $LANG['please_wait']; ?>').attr("class","").show(); |
|
| 166 | 166 | |
| 167 | 167 | //Get list of selected folders |
| 168 | 168 | var ids = ""; |
@@ -172,19 +172,19 @@ discard block |
||
| 172 | 172 | }); |
| 173 | 173 | |
| 174 | 174 | if (ids == "") { |
| 175 | - $("#offline_information").show().html("<?php echo $LANG['error_no_selected_folder'];?>").attr("class","ui-state-error"); |
|
| 175 | + $("#offline_information").show().html("<?php echo $LANG['error_no_selected_folder']; ?>").attr("class","ui-state-error"); |
|
| 176 | 176 | setTimeout(function(){$("#offline_information").effect( "fade", "slow" );}, 1000); |
| 177 | 177 | return; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | if ($("#offline_password").val() == "") { |
| 181 | - $("#offline_information").show().html("<?php echo $LANG['pdf_password_warning'];?>").attr("class","ui-state-error"); |
|
| 181 | + $("#offline_information").show().html("<?php echo $LANG['pdf_password_warning']; ?>").attr("class","ui-state-error"); |
|
| 182 | 182 | setTimeout(function(){$("#offline_information").effect( "fade", "slow" );}, 1000); |
| 183 | 183 | return; |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | if ($("#offline_pw_strength_value").val() < $("#min_offline_pw_strength_value").val()) { |
| 187 | - $("#offline_information").addClass("ui-state-error ui-corner-all").show().html("<?php echo $LANG['error_complex_not_enought'];?>"); |
|
| 187 | + $("#offline_information").addClass("ui-state-error ui-corner-all").show().html("<?php echo $LANG['error_complex_not_enought']; ?>"); |
|
| 188 | 188 | setTimeout(function(){$("#offline_information").effect( "fade", "slow" );}, 1000); |
| 189 | 189 | return; |
| 190 | 190 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | // prpare list of ids to treat during this run |
| 218 | 218 | if (idsList != "") { |
| 219 | - $("#offline_information").html('<i class="fa fa-cog fa-spin"></i> <?php echo $LANG['please_wait'];?> - ' + Math.round((parseInt(cpt)*100)/parseInt(number)) + "%"); |
|
| 219 | + $("#offline_information").html('<i class="fa fa-cog fa-spin"></i> <?php echo $LANG['please_wait']; ?> - ' + Math.round((parseInt(cpt)*100)/parseInt(number)) + "%"); |
|
| 220 | 220 | |
| 221 | 221 | tab = idsList.split(';'); |
| 222 | 222 | idTree = tab[0]; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $("#tbl_categories").append( |
| 63 | 63 | '<tr id="t_cat_'+data[0].id+'"><td colspan="2">'+ |
| 64 | 64 | '<input type="text" id="catOrd_'+data[0].id+'" size="1" class="category_order" value="1" /> '+ |
| 65 | - '<span class="fa-stack tip" title="<?php echo $LANG['field_add_in_category'];?>" onclick="fieldAdd('+ |
|
| 65 | + '<span class="fa-stack tip" title="<?php echo $LANG['field_add_in_category']; ?>" onclick="fieldAdd('+ |
|
| 66 | 66 | data[0].id+')" style="cursor:pointer;">'+ |
| 67 | 67 | '<i class="fa fa-square fa-stack-2x"></i><i class="fa fa-plus fa-stack-1x fa-inverse"></i>'+ |
| 68 | 68 | '</span> '+ |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | '<label for="item_'+data[0].id+'_cat" id="item_'+data[0].id+'">'+ |
| 71 | 71 | $("#new_category_label").val()+'</label>'+ |
| 72 | 72 | '</td><td>'+ |
| 73 | - '<span class="fa-stack tip" title="<?php echo $LANG['category_in_folders'];?>" onclick="catInFolders('+data[0].id+')" style="cursor:pointer;">'+ |
|
| 73 | + '<span class="fa-stack tip" title="<?php echo $LANG['category_in_folders']; ?>" onclick="catInFolders('+data[0].id+')" style="cursor:pointer;">'+ |
|
| 74 | 74 | '<i class="fa fa-square fa-stack-2x"></i><i class="fa fa-edit fa-stack-1x fa-inverse"></i>'+ |
| 75 | 75 | '</span> '+ |
| 76 | - '<?php echo $LANG['category_in_folders_title'];?>:'+ |
|
| 76 | + '<?php echo $LANG['category_in_folders_title']; ?>:'+ |
|
| 77 | 77 | '<span style="font-family:italic; margin-left:10px;" id="catFolders_'+data[0].id+'"></span>'+ |
| 78 | 78 | '<input type="hidden" id="catFoldersList_'+data[0].id+'" value="'+data[0].id+'" /></td><td></td>'); |
| 79 | 79 | // Add new cat |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | var data = $("input[name=sel_item]:checked").attr("id").split('_'); |
| 95 | 95 | $("#post_id").val(data[1]); |
| 96 | 96 | $("#post_type").val("renameItem"); |
| 97 | - $("#category_confirm_text").html("<?php echo $LANG['confirm_rename'];?>"); |
|
| 97 | + $("#category_confirm_text").html("<?php echo $LANG['confirm_rename']; ?>"); |
|
| 98 | 98 | $("#category_confirm").dialog("open"); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | var data = $("input[name=sel_item]:checked").attr("id").split('_'); |
| 106 | 106 | $("#post_id").val(data[1]); |
| 107 | 107 | $("#post_type").val("deleteCategory"); |
| 108 | - $("#category_confirm_text").html("<?php echo $LANG['confirm_deletion'];?>"); |
|
| 108 | + $("#category_confirm_text").html("<?php echo $LANG['confirm_deletion']; ?>"); |
|
| 109 | 109 | $("#category_confirm").dialog("open"); |
| 110 | 110 | } |
| 111 | 111 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | var data = $("input[name=sel_item]:checked").attr("id").split('_'); |
| 117 | 117 | $("#post_id").val(data[1]); |
| 118 | 118 | $("#post_type").val("moveItem"); |
| 119 | - $("#category_confirm_text").html("<?php echo $LANG['confirm_moveto'];?>"); |
|
| 119 | + $("#category_confirm_text").html("<?php echo $LANG['confirm_moveto']; ?>"); |
|
| 120 | 120 | $("#category_confirm").dialog("open"); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | "sources/categories.queries.php", |
| 168 | 168 | { |
| 169 | 169 | type : "loadFieldsList", |
| 170 | - title : prepareExchangedData(sanitizeString($("#new_category_label").val()), "encode", "<?php echo $_SESSION['key'];?>") |
|
| 170 | + title : prepareExchangedData(sanitizeString($("#new_category_label").val()), "encode", "<?php echo $_SESSION['key']; ?>") |
|
| 171 | 171 | }, |
| 172 | 172 | function(data) { |
| 173 | 173 | var newList = '<table id="tbl_categories" style="">'; |
@@ -177,17 +177,17 @@ discard block |
||
| 177 | 177 | if (val[0] === "1") { |
| 178 | 178 | newList += '<tr id="t_cat_'+val[1]+'"><td colspan="2">'+ |
| 179 | 179 | '<input type="text" id="catOrd_'+val[1]+'" size="1" class="category_order" value="'+val[3]+'" /> '+ |
| 180 | - '<span class="fa-stack tip" title="<?php echo $LANG['field_add_in_category'];?>" onclick="fieldAdd('+ |
|
| 180 | + '<span class="fa-stack tip" title="<?php echo $LANG['field_add_in_category']; ?>" onclick="fieldAdd('+ |
|
| 181 | 181 | val[1]+')" style="cursor:pointer;">'+ |
| 182 | 182 | '<i class="fa fa-square fa-stack-2x"></i><i class="fa fa-plus fa-stack-1x fa-inverse"></i>'+ |
| 183 | 183 | '</span> '+ |
| 184 | 184 | '<input type="radio" name="sel_item" id="item_'+val[1]+'_cat" />'+ |
| 185 | 185 | '<label for="item_'+val[1]+'_cat" id="item_'+val[1]+'">'+val[2]+'</label>'+ |
| 186 | 186 | '</td><td>'+ |
| 187 | - '<span class="fa-stack tip" title="<?php echo $LANG['category_in_folders'];?>" onclick="catInFolders('+val[1]+')" style="cursor:pointer;">'+ |
|
| 187 | + '<span class="fa-stack tip" title="<?php echo $LANG['category_in_folders']; ?>" onclick="catInFolders('+val[1]+')" style="cursor:pointer;">'+ |
|
| 188 | 188 | '<i class="fa fa-square fa-stack-2x"></i><i class="fa fa-edit fa-stack-1x fa-inverse"></i>'+ |
| 189 | 189 | '</span> '+ |
| 190 | - '<?php echo $LANG['category_in_folders_title'];?>:'+ |
|
| 190 | + '<?php echo $LANG['category_in_folders_title']; ?>:'+ |
|
| 191 | 191 | '<span style="font-family:italic; margin-left:10px;" id="catFolders_'+val[1]+'">'+val[4]+'</span>'+ |
| 192 | 192 | '<input type="hidden" id="catFoldersList_'+val[1]+'" value="'+val[5]+'" /></td></tr>'; |
| 193 | 193 | } else { |
@@ -199,9 +199,9 @@ discard block |
||
| 199 | 199 | if (val[4] !== "") { |
| 200 | 200 | newList += '<span id="encryt_data_'+val[1]+'" style="margin-left:4px; cursor:pointer;">'; |
| 201 | 201 | if (val[4] === "1") { |
| 202 | - newList += '<i class="fa fa-key tip" title="<?php echo $LANG['encrypted_data'];?>" onclick="changeEncrypMode('+val[1]+', 1)"></i>'; |
|
| 202 | + newList += '<i class="fa fa-key tip" title="<?php echo $LANG['encrypted_data']; ?>" onclick="changeEncrypMode('+val[1]+', 1)"></i>'; |
|
| 203 | 203 | } else if (val[4] === "0") { |
| 204 | - newList += '<span class="fa-stack" title="<?php echo $LANG['not_encrypted_data'];?>" onclick="changeEncrypMode('+val[1]+', 0)"><i class="fa fa-key fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></i></span>'; |
|
| 204 | + newList += '<span class="fa-stack" title="<?php echo $LANG['not_encrypted_data']; ?>" onclick="changeEncrypMode('+val[1]+', 0)"><i class="fa fa-key fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></i></span>'; |
|
| 205 | 205 | } |
| 206 | 206 | newList += '</span>' |
| 207 | 207 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | else if (action === "admin_action_change_salt_key") { |
| 235 | 235 | option = aes_encrypt(sanitizeString($("#new_salt_key").val())); |
| 236 | 236 | } else if (action === "admin_email_send_backlog") { |
| 237 | - $("#email_testing_results").show().html("<?php echo addslashes($LANG['please_wait']);?>").attr("class","ui-corner-all ui-state-focus"); |
|
| 237 | + $("#email_testing_results").show().html("<?php echo addslashes($LANG['please_wait']); ?>").attr("class","ui-corner-all ui-state-focus"); |
|
| 238 | 238 | } else if (action === "admin_action_attachments_cryption") { |
| 239 | 239 | option = $("input[name=attachments_cryption]:checked").val(); |
| 240 | 240 | if (option === "" || option === undefined) { |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | if (option === "" || option.length === 0) return; |
| 262 | 262 | |
| 263 | 263 | // convert to json string |
| 264 | - option = prepareExchangedData(JSON.stringify(option) , "encode", "<?php echo $_SESSION['key'];?>"); |
|
| 264 | + option = prepareExchangedData(JSON.stringify(option) , "encode", "<?php echo $_SESSION['key']; ?>"); |
|
| 265 | 265 | } |
| 266 | 266 | //Lauchn ajax query |
| 267 | 267 | $.post( |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $("#div_loading").hide(); |
| 275 | 275 | if (data != null) { |
| 276 | 276 | if (data[0].result == "db_backup") { |
| 277 | - $("#result_admin_action_db_backup").html("<span class='fa fa-file-code-o'></span> <a href='"+data[0].href+"'><?php echo $LANG['pdf_download'];?></a>").show(); |
|
| 277 | + $("#result_admin_action_db_backup").html("<span class='fa fa-file-code-o'></span> <a href='"+data[0].href+"'><?php echo $LANG['pdf_download']; ?></a>").show(); |
|
| 278 | 278 | } else if (data[0].result == "pf_done") { |
| 279 | 279 | $("#result_admin_action_check_pf").html("<span class='fa fa-check mi-green'></span>").show(); |
| 280 | 280 | } else if (data[0].result == "db_restore") { |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | } else if (data[0].result == "db_optimize") { |
| 290 | 290 | $("#result_admin_action_db_optimize").html("<span class='fa fa-check mi-green'></span>").show(); |
| 291 | 291 | } else if (data[0].result == "purge_old_files") { |
| 292 | - $("#result_admin_action_purge_old_files").html("<span class='fa fa-check mi-green'></span> "+data[0].nb_files_deleted+" <? echo $LANG['admin_action_purge_old_files_result'];?>").show(); |
|
| 292 | + $("#result_admin_action_purge_old_files").html("<span class='fa fa-check mi-green'></span> "+data[0].nb_files_deleted+" <? echo $LANG['admin_action_purge_old_files_result']; ?>").show(); |
|
| 293 | 293 | } else if (data[0].result == "db_clean_items") { |
| 294 | - $("#result_admin_action_db_clean_items").html("<span class='fa fa-check mi-green'></span> "+data[0].nb_items_deleted+" <?php echo $LANG['admin_action_db_clean_items_result'];?>").show(); |
|
| 294 | + $("#result_admin_action_db_clean_items").html("<span class='fa fa-check mi-green'></span> "+data[0].nb_items_deleted+" <?php echo $LANG['admin_action_db_clean_items_result']; ?>").show(); |
|
| 295 | 295 | } else if (data[0].result == "changed_salt_key") { |
| 296 | 296 | //deconnect user |
| 297 | 297 | $("#menu_action").val("deconnexion"); |
@@ -299,9 +299,9 @@ discard block |
||
| 299 | 299 | window.location.href = "logout.php" |
| 300 | 300 | } else if (data[0].result == "email_test_conf" || data[0].result == "admin_email_send_backlog") { |
| 301 | 301 | if (data[0].error != "") { |
| 302 | - $("#email_testing_results").html("<?php echo addslashes($LANG['admin_email_result_nok']);?> "+data[0].message).show().attr("class","ui-state-error ui-corner-all"); |
|
| 302 | + $("#email_testing_results").html("<?php echo addslashes($LANG['admin_email_result_nok']); ?> "+data[0].message).show().attr("class","ui-state-error ui-corner-all"); |
|
| 303 | 303 | } else { |
| 304 | - $("#email_testing_results").html("<?php echo addslashes(str_replace("#email#", $_SESSION['user_email'], $LANG['admin_email_result_ok']));?>").show().attr("class","ui-corner-all ui-state-focus"); |
|
| 304 | + $("#email_testing_results").html("<?php echo addslashes(str_replace("#email#", $_SESSION['user_email'], $LANG['admin_email_result_ok'])); ?>").show().attr("class","ui-corner-all ui-state-focus"); |
|
| 305 | 305 | } |
| 306 | 306 | } else if (data[0].result == "pw_prefix_correct") { |
| 307 | 307 | $("result_admin_action_pw_prefix_correct").html(data[0].ret).show(); |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | } else if (data[0].result === "backup_decrypt_fails") { |
| 327 | 327 | $("#result_admin_script_backup").html(data[0].msg).show(); |
| 328 | 328 | } else if (data[0].result === "backup_decrypt_success") { |
| 329 | - $("#result_admin_script_backup").html("<span class='fa fa-check mi-green'></span> <?php echo addslashes($LANG['file_is_now_ready']);?> - " + data[0].msg).show(1).delay(5000).fadeOut(500); |
|
| 329 | + $("#result_admin_script_backup").html("<span class='fa fa-check mi-green'></span> <?php echo addslashes($LANG['file_is_now_ready']); ?> - " + data[0].msg).show(1).delay(5000).fadeOut(500); |
|
| 330 | 330 | } |
| 331 | 331 | //-- |
| 332 | 332 | } |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | * |
| 340 | 340 | */ |
| 341 | 341 | function confirmChangingSk() { |
| 342 | - if (confirm("<?php echo addslashes($LANG['confirm_database_reencryption']);?>")) { |
|
| 342 | + if (confirm("<?php echo addslashes($LANG['confirm_database_reencryption']); ?>")) { |
|
| 343 | 343 | changeMainSaltKey('starting', ''); |
| 344 | 344 | } |
| 345 | 345 | } |
@@ -360,14 +360,14 @@ discard block |
||
| 360 | 360 | // start change |
| 361 | 361 | if (start === "starting") { |
| 362 | 362 | // inform |
| 363 | - $("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i> <?php echo $LANG['starting'];?>").show(); |
|
| 363 | + $("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i> <?php echo $LANG['starting']; ?>").show(); |
|
| 364 | 364 | |
| 365 | 365 | // launch query |
| 366 | 366 | $.post( |
| 367 | 367 | "sources/admin.queries.php", |
| 368 | 368 | { |
| 369 | 369 | type : "admin_action_change_salt_key___start", |
| 370 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 370 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 371 | 371 | }, |
| 372 | 372 | function(data) { |
| 373 | 373 | if (data[0].error == "" && data[0].nextAction == "encrypt_items") { |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | //changeMainSaltKey(0, "files"); |
| 380 | 380 | } else { |
| 381 | 381 | // error mngt |
| 382 | - $("#changeMainSaltKey_message").html("<i class=\"fa fa-alert fa-spin fa\"></i> <?php echo $LANG['error_sent_back'];?> : "+data[0].error); |
|
| 382 | + $("#changeMainSaltKey_message").html("<i class=\"fa fa-alert fa-spin fa\"></i> <?php echo $LANG['error_sent_back']; ?> : "+data[0].error); |
|
| 383 | 383 | } |
| 384 | 384 | }, |
| 385 | 385 | "json" |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | } else if (isFinite(start) && object !== "") { |
| 389 | 389 | console.log("Step Encrypt - " +start+" ; "+nb+" ; "+$("#changeMainSaltKey_itemsCount").val()); |
| 390 | 390 | |
| 391 | - $("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i> <?php echo $LANG['treating_items'];?>... "+start+" > "+(parseInt(start)+parseInt(nb))+" (<?php echo $LANG['total_number_of_items'];?> : "+$("#changeMainSaltKey_itemsCount").val()+")"); |
|
| 391 | + $("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i> <?php echo $LANG['treating_items']; ?>... "+start+" > "+(parseInt(start)+parseInt(nb))+" (<?php echo $LANG['total_number_of_items']; ?> : "+$("#changeMainSaltKey_itemsCount").val()+")"); |
|
| 392 | 392 | |
| 393 | 393 | $.post( |
| 394 | 394 | "sources/admin.queries.php", |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | start : start, |
| 399 | 399 | length : nb, |
| 400 | 400 | nbItems : $("#changeMainSaltKey_itemsCount").val(), |
| 401 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 401 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 402 | 402 | }, |
| 403 | 403 | function(data) { |
| 404 | 404 | console.log("Next action: "+data[0].nextAction); |
@@ -412,11 +412,11 @@ discard block |
||
| 412 | 412 | } |
| 413 | 413 | changeMainSaltKey(data[0].nextStart, object); |
| 414 | 414 | } else if (data[0].nextAction === "finishing") { |
| 415 | - $("#changeMainSaltKey_message").html("<?php echo $LANG['finalizing'];?>..."); |
|
| 415 | + $("#changeMainSaltKey_message").html("<?php echo $LANG['finalizing']; ?>..."); |
|
| 416 | 416 | changeMainSaltKey("finishing"); |
| 417 | 417 | } else { |
| 418 | 418 | // error mngt |
| 419 | - $("#changeMainSaltKey_message").html("<i class=\"fa fa-alert fa-spin fa\"></i> <?php echo $LANG['error_sent_back'];?> : "+data[0].error); |
|
| 419 | + $("#changeMainSaltKey_message").html("<i class=\"fa fa-alert fa-spin fa\"></i> <?php echo $LANG['error_sent_back']; ?> : "+data[0].error); |
|
| 420 | 420 | } |
| 421 | 421 | }, |
| 422 | 422 | "json" |
@@ -427,12 +427,12 @@ discard block |
||
| 427 | 427 | "sources/admin.queries.php", |
| 428 | 428 | { |
| 429 | 429 | type : "admin_action_change_salt_key___end", |
| 430 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 430 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 431 | 431 | }, |
| 432 | 432 | function(data) { |
| 433 | 433 | if (data[0].nextAction === "done") { |
| 434 | 434 | console.log("done"); |
| 435 | - $("#changeMainSaltKey_message").html("<i class=\"fa fa-info fa-lg\"></i> <?php echo $LANG['alert_message_done']." ".$LANG['number_of_items_treated'];?> : " + $("#changeMainSaltKey_itemsCountTotal").val() + '<p><?php echo $LANG['check_data_after_reencryption'];?><p><div style=\"margin-top:5px;\"><a href=\"#\" onclick=\"encryption_show_revert()\"><?php echo $LANG['revert'];?></a></div>'); |
|
| 435 | + $("#changeMainSaltKey_message").html("<i class=\"fa fa-info fa-lg\"></i> <?php echo $LANG['alert_message_done']." ".$LANG['number_of_items_treated']; ?> : " + $("#changeMainSaltKey_itemsCountTotal").val() + '<p><?php echo $LANG['check_data_after_reencryption']; ?><p><div style=\"margin-top:5px;\"><a href=\"#\" onclick=\"encryption_show_revert()\"><?php echo $LANG['revert']; ?></a></div>'); |
|
| 436 | 436 | } else { |
| 437 | 437 | // error mngt |
| 438 | 438 | } |
@@ -444,13 +444,13 @@ discard block |
||
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | function encryption_show_revert() { |
| 447 | - if (confirm('<?php echo $LANG['revert_the_database'];?>')) { |
|
| 448 | - $("#changeMainSaltKey_message").append('<div style="margin-top:5px;"><i class="fa fa-cog fa-spin fa-lg"></i> <?php echo addslashes($LANG['please_wait']);?>...</div>') |
|
| 447 | + if (confirm('<?php echo $LANG['revert_the_database']; ?>')) { |
|
| 448 | + $("#changeMainSaltKey_message").append('<div style="margin-top:5px;"><i class="fa fa-cog fa-spin fa-lg"></i> <?php echo addslashes($LANG['please_wait']); ?>...</div>') |
|
| 449 | 449 | $.post( |
| 450 | 450 | "sources/admin.queries.php", |
| 451 | 451 | { |
| 452 | 452 | type : "admin_action_change_salt_key___restore_backup", |
| 453 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 453 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 454 | 454 | }, |
| 455 | 455 | function(data) { |
| 456 | 456 | $("#changeMainSaltKey_message").html('').hide(); |
@@ -474,8 +474,8 @@ discard block |
||
| 474 | 474 | "sources/admin.queries.php", |
| 475 | 475 | { |
| 476 | 476 | type : "save_option_change", |
| 477 | - data : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key'];?>"), |
|
| 478 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 477 | + data : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key']; ?>"), |
|
| 478 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 479 | 479 | }, |
| 480 | 480 | function(data) { |
| 481 | 481 | // force page reload in case of encryptClientServer |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | } |
| 486 | 486 | //decrypt data |
| 487 | 487 | try { |
| 488 | - data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key'];?>"); |
|
| 488 | + data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key']; ?>"); |
|
| 489 | 489 | } catch (e) { |
| 490 | 490 | // error |
| 491 | 491 | $("#message_box").html("An error appears. Answer from Server cannot be parsed!<br />Returned data:<br />"+data).show().fadeOut(4000); |
@@ -524,8 +524,8 @@ discard block |
||
| 524 | 524 | drag: true, // allow dragging the toggle between positions |
| 525 | 525 | click: true, // allow clicking on the toggle |
| 526 | 526 | text: { |
| 527 | - on: '<?php echo $LANG['yes'];?>', // text for the ON position |
|
| 528 | - off: '<?php echo $LANG['no'];?>' // and off |
|
| 527 | + on: '<?php echo $LANG['yes']; ?>', // text for the ON position |
|
| 528 | + off: '<?php echo $LANG['no']; ?>' // and off |
|
| 529 | 529 | }, |
| 530 | 530 | on: true, // is the toggle ON on init |
| 531 | 531 | animate: 250, // animation time (ms) |
@@ -550,8 +550,8 @@ discard block |
||
| 550 | 550 | "sources/admin.queries.php", |
| 551 | 551 | { |
| 552 | 552 | type : "save_option_change", |
| 553 | - data : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key'];?>"), |
|
| 554 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 553 | + data : prepareExchangedData(data, "encode", "<?php echo $_SESSION['key']; ?>"), |
|
| 554 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 555 | 555 | }, |
| 556 | 556 | function(data) { |
| 557 | 557 | // force page reload in case of encryptClientServer |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | } |
| 562 | 562 | //decrypt data |
| 563 | 563 | try { |
| 564 | - data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key'];?>"); |
|
| 564 | + data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key']; ?>"); |
|
| 565 | 565 | } catch (e) { |
| 566 | 566 | // error |
| 567 | 567 | $("#message_box").html("An error appears. Answer from Server cannot be parsed!<br />Returned data:<br />"+data).show().fadeOut(4000); |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | } |
| 606 | 606 | }, |
| 607 | 607 | beforeLoad: function( event, ui ) { |
| 608 | - ui.panel.html('<div id="loader_tab"><i class="fa fa-cog fa-spin"></i> <?php echo $LANG['loading'];?>...</div>') |
|
| 608 | + ui.panel.html('<div id="loader_tab"><i class="fa fa-cog fa-spin"></i> <?php echo $LANG['loading']; ?>...</div>') |
|
| 609 | 609 | }, |
| 610 | 610 | load: function( event, ui ) { |
| 611 | 611 | $("#loader_tab").remove(); |
@@ -638,9 +638,9 @@ discard block |
||
| 638 | 638 | autoOpen: false, |
| 639 | 639 | width: 400, |
| 640 | 640 | height: 120, |
| 641 | - title: "<?php echo $LANG['confirm'];?>", |
|
| 641 | + title: "<?php echo $LANG['confirm']; ?>", |
|
| 642 | 642 | buttons: { |
| 643 | - "<?php echo $LANG['confirm'];?>": function() { |
|
| 643 | + "<?php echo $LANG['confirm']; ?>": function() { |
|
| 644 | 644 | $("#div_loading").show(); |
| 645 | 645 | var $this = $(this); |
| 646 | 646 | // prepare data to send |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | "json" |
| 676 | 676 | ); |
| 677 | 677 | }, |
| 678 | - "<?php echo $LANG['cancel_button'];?>": function() { |
|
| 678 | + "<?php echo $LANG['cancel_button']; ?>": function() { |
|
| 679 | 679 | $("#div_loading").hide(); |
| 680 | 680 | $(this).dialog("close"); |
| 681 | 681 | } |
@@ -688,9 +688,9 @@ discard block |
||
| 688 | 688 | autoOpen: false, |
| 689 | 689 | width: 500, |
| 690 | 690 | height: 150, |
| 691 | - title: "<?php echo $LANG['category_in_folders'];?>", |
|
| 691 | + title: "<?php echo $LANG['category_in_folders']; ?>", |
|
| 692 | 692 | buttons: { |
| 693 | - "<?php echo $LANG['confirm'];?>": function() { |
|
| 693 | + "<?php echo $LANG['confirm']; ?>": function() { |
|
| 694 | 694 | if ($("#new_field_title").val() != "" && $("#post_id").val() != "") { |
| 695 | 695 | $("#div_loading").show(); |
| 696 | 696 | var $this = $(this); |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | ); |
| 713 | 713 | } |
| 714 | 714 | }, |
| 715 | - "<?php echo $LANG['cancel_button'];?>": function() { |
|
| 715 | + "<?php echo $LANG['cancel_button']; ?>": function() { |
|
| 716 | 716 | $("#div_loading").hide(); |
| 717 | 717 | $(this).dialog("close"); |
| 718 | 718 | } |
@@ -722,8 +722,8 @@ discard block |
||
| 722 | 722 | $("#cat_folders_selection").multiselect({ |
| 723 | 723 | selectedList: 7, |
| 724 | 724 | multiple:true, |
| 725 | - checkAllText: "<?php echo $LANG['check_all_text'];?>", |
|
| 726 | - uncheckAllText: "<?php echo $LANG['uncheck_all_text'];?>" |
|
| 725 | + checkAllText: "<?php echo $LANG['check_all_text']; ?>", |
|
| 726 | + uncheckAllText: "<?php echo $LANG['uncheck_all_text']; ?>" |
|
| 727 | 727 | }); |
| 728 | 728 | |
| 729 | 729 | $("#category_in_folder").dialog({ |
@@ -732,12 +732,12 @@ discard block |
||
| 732 | 732 | autoOpen: false, |
| 733 | 733 | width: 400, |
| 734 | 734 | height: 350, |
| 735 | - title: "<?php echo $LANG['category_in_folders'];?>", |
|
| 735 | + title: "<?php echo $LANG['category_in_folders']; ?>", |
|
| 736 | 736 | open: function() { |
| 737 | 737 | $("#cat_folders_selection").multiselect('refresh'); |
| 738 | 738 | }, |
| 739 | 739 | buttons: { |
| 740 | - "<?php echo $LANG['confirm'];?>": function() { |
|
| 740 | + "<?php echo $LANG['confirm']; ?>": function() { |
|
| 741 | 741 | // get list of selected folders |
| 742 | 742 | var ids = ""; |
| 743 | 743 | $("#cat_folders_selection :selected").each(function(i, selected) { |
@@ -767,7 +767,7 @@ discard block |
||
| 767 | 767 | ); |
| 768 | 768 | } |
| 769 | 769 | }, |
| 770 | - "<?php echo $LANG['cancel_button'];?>": function() { |
|
| 770 | + "<?php echo $LANG['cancel_button']; ?>": function() { |
|
| 771 | 771 | $("#div_loading").hide(); |
| 772 | 772 | $(this).dialog("close"); |
| 773 | 773 | } |
@@ -780,12 +780,12 @@ discard block |
||
| 780 | 780 | autoOpen: false, |
| 781 | 781 | width:250, |
| 782 | 782 | height:150, |
| 783 | - title: "<?php echo $LANG['admin_action_db_restore_key'];?>", |
|
| 783 | + title: "<?php echo $LANG['admin_action_db_restore_key']; ?>", |
|
| 784 | 784 | buttons: { |
| 785 | - "<?php echo $LANG['ok'];?>": function() { |
|
| 785 | + "<?php echo $LANG['ok']; ?>": function() { |
|
| 786 | 786 | LaunchAdminActions("admin_action_db_restore", $("#restore_bck_fileObj").val()+"&"+$("#restore_bck_encryption_key").val()); |
| 787 | 787 | }, |
| 788 | - "<?php echo $LANG['cancel_button'];?>'": function() { |
|
| 788 | + "<?php echo $LANG['cancel_button']; ?>'": function() { |
|
| 789 | 789 | $(this).dialog("close"); |
| 790 | 790 | } |
| 791 | 791 | } |
@@ -911,11 +911,11 @@ discard block |
||
| 911 | 911 | $.post("sources/admin.queries.php", |
| 912 | 912 | { |
| 913 | 913 | type : "is_backup_table_existing", |
| 914 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 914 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 915 | 915 | }, |
| 916 | 916 | function(data) { |
| 917 | 917 | if (data === "1") { |
| 918 | - $("#changeMainSaltKey_message").show().html('<?php echo addslashes($LANG['previous_backup_exists']);?> <b><a href="#" id="but_bck_restore"><?php echo $LANG['yes'];?></a></b><br /><?php echo $LANG['previous_backup_exists_delete'];?> <b><a href="#" id="but_bck_delete"><?php echo $LANG['yes'];?></a></b>'); |
|
| 918 | + $("#changeMainSaltKey_message").show().html('<?php echo addslashes($LANG['previous_backup_exists']); ?> <b><a href="#" id="but_bck_restore"><?php echo $LANG['yes']; ?></a></b><br /><?php echo $LANG['previous_backup_exists_delete']; ?> <b><a href="#" id="but_bck_delete"><?php echo $LANG['yes']; ?></a></b>'); |
|
| 919 | 919 | |
| 920 | 920 | // Restore the backup |
| 921 | 921 | $("#but_bck_restore").click(function(e) { |
@@ -924,13 +924,13 @@ discard block |
||
| 924 | 924 | |
| 925 | 925 | // Delete the backup |
| 926 | 926 | $("#but_bck_delete").click(function(e) { |
| 927 | - if (confirm("<?php echo $LANG['wipe_backup_data'];?>")) { |
|
| 928 | - $("#changeMainSaltKey_message").append('<div style="margin-top:5px;"><i class="fa fa-cog fa-spin fa-lg"></i> <?php echo addslashes($LANG['please_wait']);?>...</div>') |
|
| 927 | + if (confirm("<?php echo $LANG['wipe_backup_data']; ?>")) { |
|
| 928 | + $("#changeMainSaltKey_message").append('<div style="margin-top:5px;"><i class="fa fa-cog fa-spin fa-lg"></i> <?php echo addslashes($LANG['please_wait']); ?>...</div>') |
|
| 929 | 929 | $.post( |
| 930 | 930 | "sources/admin.queries.php", |
| 931 | 931 | { |
| 932 | 932 | type : "admin_action_change_salt_key___delete_backup", |
| 933 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 933 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 934 | 934 | }, |
| 935 | 935 | function(data) { |
| 936 | 936 | $("#changeMainSaltKey_message").html('').hide(); |
@@ -995,9 +995,9 @@ discard block |
||
| 995 | 995 | // show to user |
| 996 | 996 | if (data[0].error === ""){ |
| 997 | 997 | if (encrypted_data === "1") { |
| 998 | - $("#encryt_data_"+id).html('<span class="fa-stack" title="<?php echo $LANG['not_encrypted_data'];?>" onclick="changeEncrypMode(\''+id+'\', \'0\')"><i class="fa fa-key fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></i></span>'); |
|
| 998 | + $("#encryt_data_"+id).html('<span class="fa-stack" title="<?php echo $LANG['not_encrypted_data']; ?>" onclick="changeEncrypMode(\''+id+'\', \'0\')"><i class="fa fa-key fa-stack-1x"></i><i class="fa fa-ban fa-stack-1x fa-lg" style="color:red;"></i></span>'); |
|
| 999 | 999 | } else { |
| 1000 | - $("#encryt_data_"+id).html('<i class="fa fa-key tip" title="<?php echo $LANG['encrypted_data'];?>" onclick="changeEncrypMode(\''+id+'\', \'1\')"></i>'); |
|
| 1000 | + $("#encryt_data_"+id).html('<i class="fa fa-key tip" title="<?php echo $LANG['encrypted_data']; ?>" onclick="changeEncrypMode(\''+id+'\', \'1\')"></i>'); |
|
| 1001 | 1001 | } |
| 1002 | 1002 | } |
| 1003 | 1003 | $("#div_loading").hide(); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | //<![CDATA[ |
| 22 | 22 | function aes_decrypt(text) |
| 23 | 23 | { |
| 24 | - return Aes.Ctr.decrypt(text, "<?php echo $_SESSION['key'];?>", 256); |
|
| 24 | + return Aes.Ctr.decrypt(text, "<?php echo $_SESSION['key']; ?>", 256); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /* |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | "sources/items.queries.php", |
| 39 | 39 | { |
| 40 | 40 | type : "refresh_visible_folders", |
| 41 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 41 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 42 | 42 | }, |
| 43 | 43 | function(data) { |
| 44 | - data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key'];?>"); |
|
| 44 | + data = prepareExchangedData(data , "decode", "<?php echo $_SESSION['key']; ?>"); |
|
| 45 | 45 | $("#copy_in_folder").find('option').remove().end().append(data.selectFullVisibleFoldersOptions); |
| 46 | 46 | $('#div_copy_item_to_folder').dialog('open'); |
| 47 | 47 | } |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | autoOpen: false, |
| 56 | 56 | width: 400, |
| 57 | 57 | height: 200, |
| 58 | - title: "<?php echo $LANG['item_menu_copy_elem'];?>", |
|
| 58 | + title: "<?php echo $LANG['item_menu_copy_elem']; ?>", |
|
| 59 | 59 | buttons: { |
| 60 | - "<?php echo $LANG['ok'];?>": function() { |
|
| 60 | + "<?php echo $LANG['ok']; ?>": function() { |
|
| 61 | 61 | //Send query |
| 62 | 62 | $.post( |
| 63 | 63 | "sources/items.queries.php", |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | type : "copy_item", |
| 66 | 66 | item_id : $('#id_selected_item').val(), |
| 67 | 67 | folder_id : $('#copy_in_folder').val(), |
| 68 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 68 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 69 | 69 | }, |
| 70 | 70 | function(data) { |
| 71 | 71 | //check if format error |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | //if OK |
| 76 | 76 | if (data[0].status == "ok") { |
| 77 | - $("#div_dialog_message_text").html("<?php echo $LANG['alert_message_done'];?>"); |
|
| 77 | + $("#div_dialog_message_text").html("<?php echo $LANG['alert_message_done']; ?>"); |
|
| 78 | 78 | $("#div_dialog_message").dialog('open'); |
| 79 | 79 | $("#div_copy_item_to_folder").dialog('close'); |
| 80 | 80 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | "json" |
| 83 | 83 | ); |
| 84 | 84 | }, |
| 85 | - "<?php echo $LANG['cancel_button'];?>": function() { |
|
| 85 | + "<?php echo $LANG['cancel_button']; ?>": function() { |
|
| 86 | 86 | $("#copy_item_to_folder_show_error").html("").hide(); |
| 87 | 87 | $(this).dialog('close'); |
| 88 | 88 | } |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | autoOpen: false, |
| 106 | 106 | width: 450, |
| 107 | 107 | height: 220, |
| 108 | - title: "<?php echo $LANG['see_item_title'];?>", |
|
| 108 | + title: "<?php echo $LANG['see_item_title']; ?>", |
|
| 109 | 109 | open: |
| 110 | 110 | function(event, ui) { |
| 111 | - $("#div_item_data_show_error").html("<?php echo $LANG['admin_info_loading'];?>").show(); |
|
| 111 | + $("#div_item_data_show_error").html("<?php echo $LANG['admin_info_loading']; ?>").show(); |
|
| 112 | 112 | $.post( |
| 113 | 113 | "sources/items.queries.php", |
| 114 | 114 | { |
@@ -117,25 +117,25 @@ discard block |
||
| 117 | 117 | salt_key_required : $('#personalItem').val(), |
| 118 | 118 | salt_key_set : $('#personal_sk_set').val(), |
| 119 | 119 | page : "find", |
| 120 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 120 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 121 | 121 | }, |
| 122 | 122 | function(data) { |
| 123 | 123 | //decrypt data |
| 124 | - data = prepareExchangedData(data, "decode", "<?php echo $_SESSION['key'];?>"); |
|
| 124 | + data = prepareExchangedData(data, "decode", "<?php echo $_SESSION['key']; ?>"); |
|
| 125 | 125 | var return_html = ""; |
| 126 | 126 | if (data.show_detail_option != "0" || data.show_details == 0) { |
| 127 | 127 | //item expired |
| 128 | - return_html = "<?php echo $LANG['not_allowed_to_see_pw_is_expired'];?>"; |
|
| 128 | + return_html = "<?php echo $LANG['not_allowed_to_see_pw_is_expired']; ?>"; |
|
| 129 | 129 | } else if (data.show_details == "0") { |
| 130 | 130 | //Admin cannot see Item |
| 131 | - return_html = "<?php echo $LANG['not_allowed_to_see_pw'];?>"; |
|
| 131 | + return_html = "<?php echo $LANG['not_allowed_to_see_pw']; ?>"; |
|
| 132 | 132 | } else { |
| 133 | 133 | return_html = "<table>"+ |
| 134 | - "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['label'];?> :</td><td style='font-style:italic;display:inline;'>"+data.label+"</td></tr>"+ |
|
| 135 | - "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['description'];?> :</td><td style='font-style:italic;display:inline;'>"+data.description+"</td></tr>"+ |
|
| 136 | - "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['pw'];?> :</td><td style='font-style:italic;display:inline;'>"+unsanitizeString(data.pw)+"</td></tr>"+ |
|
| 137 | - "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['index_login'];?> :</td><td style='font-style:italic;display:inline;'>"+data.login+"</td></tr>"+ |
|
| 138 | - "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['url'];?> :</td><td style='font-style:italic;display:inline;'>"+data.url+"</td></tr>"+ |
|
| 134 | + "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['label']; ?> :</td><td style='font-style:italic;display:inline;'>"+data.label+"</td></tr>"+ |
|
| 135 | + "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['description']; ?> :</td><td style='font-style:italic;display:inline;'>"+data.description+"</td></tr>"+ |
|
| 136 | + "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['pw']; ?> :</td><td style='font-style:italic;display:inline;'>"+unsanitizeString(data.pw)+"</td></tr>"+ |
|
| 137 | + "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['index_login']; ?> :</td><td style='font-style:italic;display:inline;'>"+data.login+"</td></tr>"+ |
|
| 138 | + "<tr><td valign='top' class='td_title'><span class='ui-icon ui-icon-carat-1-e' style='float: left; margin-right: .3em;'> </span><?php echo $LANG['url']; ?> :</td><td style='font-style:italic;display:inline;'>"+data.url+"</td></tr>"+ |
|
| 139 | 139 | "</table>"; |
| 140 | 140 | } |
| 141 | 141 | $("#div_item_data_show_error").html("").hide(); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | , |
| 152 | 152 | buttons: { |
| 153 | - "<?php echo $LANG['ok'];?>": function() { |
|
| 153 | + "<?php echo $LANG['ok']; ?>": function() { |
|
| 154 | 154 | $(this).dialog('close'); |
| 155 | 155 | } |
| 156 | 156 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | "sAjaxSource": "sources/find.queries.php", |
| 167 | 167 | "bJQueryUI": true, |
| 168 | 168 | "oLanguage": { |
| 169 | - "sUrl": "includes/language/datatables.<?php echo $_SESSION['user_language'];?>.txt" |
|
| 169 | + "sUrl": "includes/language/datatables.<?php echo $_SESSION['user_language']; ?>.txt" |
|
| 170 | 170 | }, |
| 171 | 171 | "fnInitComplete": function() { |
| 172 | 172 | $("#find_page input").focus(); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | autoOpen: false, |
| 195 | 195 | width: 500, |
| 196 | 196 | height: 400, |
| 197 | - title: "<?php echo $LANG['mass_operation'];?>", |
|
| 197 | + title: "<?php echo $LANG['mass_operation']; ?>", |
|
| 198 | 198 | open: function() { |
| 199 | 199 | var html = sel_items = sel_items_txt = item_id = ''; |
| 200 | 200 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | // prepare display |
| 215 | 215 | if ($("#div_mass_op").data('action') === "move") { |
| 216 | - html = '<?php echo $LANG['you_decided_to_move_items'];?>: ' + |
|
| 216 | + html = '<?php echo $LANG['you_decided_to_move_items']; ?>: ' + |
|
| 217 | 217 | '<div><ul>' + sel_items_txt + '</ul></div>'; |
| 218 | 218 | var folder_options = ''; |
| 219 | 219 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | "sources/folders.queries.php", |
| 223 | 223 | { |
| 224 | 224 | type : "get_list_of_folders", |
| 225 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 225 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 226 | 226 | }, |
| 227 | 227 | function(data) { |
| 228 | 228 | $("#div_loading").hide(); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | // destination folder |
| 238 | - html += '<div style=""><?php echo $LANG['import_keepass_to_folder'];?>: ' + |
|
| 238 | + html += '<div style=""><?php echo $LANG['import_keepass_to_folder']; ?>: ' + |
|
| 239 | 239 | '<select id="mass_move_destination_folder_id">' + data[0].list_folders + '</select>' + |
| 240 | 240 | '</div>'; |
| 241 | 241 | |
@@ -245,19 +245,19 @@ discard block |
||
| 245 | 245 | "json" |
| 246 | 246 | ); |
| 247 | 247 | } else if ($("#div_mass_op").data('action') === "delete") { |
| 248 | - html = '<?php echo $LANG['you_decided_to_delete_items'];?>: ' + |
|
| 248 | + html = '<?php echo $LANG['you_decided_to_delete_items']; ?>: ' + |
|
| 249 | 249 | '<div><ul>' + sel_items_txt + '</ul></div>' + |
| 250 | - '<div style="padding:10px;" class="ui-corner-all ui-state-error"><span class="fa fa-warning fa-lg"></span> <?php echo $LANG['confirm_deletion'];?></div>'; |
|
| 250 | + '<div style="padding:10px;" class="ui-corner-all ui-state-error"><span class="fa fa-warning fa-lg"></span> <?php echo $LANG['confirm_deletion']; ?></div>'; |
|
| 251 | 251 | |
| 252 | 252 | $("#div_mass_html").html(html); |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | }, |
| 256 | 256 | buttons: { |
| 257 | - "<?php echo $LANG['ok'];?>": function() { |
|
| 257 | + "<?php echo $LANG['ok']; ?>": function() { |
|
| 258 | 258 | $("#div_mass_op_msg") |
| 259 | 259 | .addClass("ui-state-highlight") |
| 260 | - .html('<span class="fa fa-cog fa-spin fa-lg"></span> <?php echo $LANG['please_wait'];?>') |
|
| 260 | + .html('<span class="fa fa-cog fa-spin fa-lg"></span> <?php echo $LANG['please_wait']; ?>') |
|
| 261 | 261 | .show(); |
| 262 | 262 | |
| 263 | 263 | var sel_items = ''; |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | if (sel_items === "") { |
| 271 | 271 | $("#div_mass_op_msg") |
| 272 | 272 | .addClass("ui-state-error") |
| 273 | - .html('<span class="fa fa-warning fa-lg"></span> <?php echo $LANG['must_select_items'];?>') |
|
| 273 | + .html('<span class="fa fa-warning fa-lg"></span> <?php echo $LANG['must_select_items']; ?>') |
|
| 274 | 274 | .show().delay(2000).fadeOut(1000); |
| 275 | 275 | return false; |
| 276 | 276 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | type : "mass_move_items", |
| 286 | 286 | item_ids : sel_items, |
| 287 | 287 | folder_id : $("#mass_move_destination_folder_id").val(), |
| 288 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 288 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 289 | 289 | }, |
| 290 | 290 | function(data) { |
| 291 | 291 | //check if format error |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | //reload search |
| 298 | 298 | oTable.api().ajax.reload(); |
| 299 | 299 | |
| 300 | - $("#main_info_box_text").html("<?php echo $LANG['alert_message_done'];?>"); |
|
| 300 | + $("#main_info_box_text").html("<?php echo $LANG['alert_message_done']; ?>"); |
|
| 301 | 301 | $("#main_info_box").show().position({ |
| 302 | 302 | my: "center", |
| 303 | 303 | at: "center top+75", |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | { |
| 321 | 321 | type : "mass_delete_items", |
| 322 | 322 | item_ids : sel_items, |
| 323 | - key : "<?php echo $_SESSION['key'];?>" |
|
| 323 | + key : "<?php echo $_SESSION['key']; ?>" |
|
| 324 | 324 | }, |
| 325 | 325 | function(data) { |
| 326 | 326 | //check if format error |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | //reload search |
| 333 | 333 | oTable.api().ajax.reload(); |
| 334 | 334 | |
| 335 | - $("#main_info_box_text").html("<?php echo $LANG['alert_message_done'];?>"); |
|
| 335 | + $("#main_info_box_text").html("<?php echo $LANG['alert_message_done']; ?>"); |
|
| 336 | 336 | $("#main_info_box").show().position({ |
| 337 | 337 | my: "center", |
| 338 | 338 | at: "center top+75", |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | ); |
| 349 | 349 | } |
| 350 | 350 | }, |
| 351 | - "<?php echo $LANG['cancel_button'];?>": function() { |
|
| 351 | + "<?php echo $LANG['cancel_button']; ?>": function() { |
|
| 352 | 352 | $(this).dialog('close'); |
| 353 | 353 | } |
| 354 | 354 | } |