@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | if (false !== $this->ldap->getDn($login)) { |
| 218 | - $this->activeServer = (int) $key; |
|
| 218 | + $this->activeServer = (int)$key; |
|
| 219 | 219 | break; |
| 220 | 220 | } |
| 221 | 221 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | htmlspecialchars_decode($password) |
| 252 | 252 | ); |
| 253 | 253 | |
| 254 | - if (! $this->ldap->bind($bindLogin, htmlspecialchars_decode($password))) { |
|
| 254 | + if (!$this->ldap->bind($bindLogin, htmlspecialchars_decode($password))) { |
|
| 255 | 255 | $this->errors[] = $this->ldap->error; |
| 256 | 256 | |
| 257 | 257 | return false; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | if (false !== $this->ldap->getDn($login)) { |
| 291 | - $this->activeServer = (int) $key; |
|
| 291 | + $this->activeServer = (int)$key; |
|
| 292 | 292 | break; |
| 293 | 293 | } |
| 294 | 294 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // Backup of config/elasticsearch.php if exists |
| 232 | 232 | if (file_exists(PMF_ROOT_DIR.'/config/elasticsearch.php')) { |
| 233 | 233 | if (!copy(PMF_ROOT_DIR.'/config/elasticsearch.php', PMF_ROOT_DIR.'/config/elasticsearch.bak.php')) { |
| 234 | - echo '<p class="alert alert-danger"><strong>Error:</strong> The backup file ' . |
|
| 234 | + echo '<p class="alert alert-danger"><strong>Error:</strong> The backup file '. |
|
| 235 | 235 | '../config/elasticsearch.bak.php could not be written. Please correct this!</p>'; |
| 236 | 236 | } else { |
| 237 | 237 | $checkElasticsearchSetupFile = true; |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | foreach ($query as $key => $executeQuery) { |
| 600 | 600 | $result = $faqConfig->getDb()->query($executeQuery); |
| 601 | 601 | echo '.'; |
| 602 | - if (!($key % 100)) { |
|
| 602 | + if (!($key%100)) { |
|
| 603 | 603 | echo '<br />'; |
| 604 | 604 | } |
| 605 | 605 | if (!$result) { |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | } |
| 620 | 620 | usleep(10000); |
| 621 | 621 | ++$count; |
| 622 | - if (!($count % 10)) { |
|
| 622 | + if (!($count%10)) { |
|
| 623 | 623 | ob_flush(); |
| 624 | 624 | } |
| 625 | 625 | } |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | $faqConfig->add('main.enableGzipCompression', 'true'); |
| 714 | 714 | |
| 715 | 715 | if ('sqlite3' === $DB['type']) { |
| 716 | - $query[] = 'ALTER TABLE ' . $prefix . 'faquser ADD COLUMN success INT(1) NULL DEFAULT 1'; |
|
| 716 | + $query[] = 'ALTER TABLE '.$prefix.'faquser ADD COLUMN success INT(1) NULL DEFAULT 1'; |
|
| 717 | 717 | } elseif ('pgsql' === $DB['type']) { |
| 718 | 718 | $query[] = 'ALTER TABLE '.$prefix.'faquser ADD success SMALLINT NULL DEFAULT 1'; |
| 719 | 719 | } else { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | // 2.5 versions only |
| 161 | 161 | if (version_compare($version, '2.6.0-alpha', '<') && !is_writeable('../template')) { |
| 162 | 162 | echo '<p class="alert alert-danger text-center"><strong>Please change the directory ../template '. |
| 163 | - 'and its contents writable (777 on Linux/UNIX).</strong></p>'; |
|
| 163 | + 'and its contents writable (777 on Linux/UNIX).</strong></p>'; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // We only support updates from 2.6+ |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | if (file_exists(PMF_ROOT_DIR.'/config/database.php')) { |
| 207 | 207 | if (!copy(PMF_ROOT_DIR.'/config/database.php', PMF_ROOT_DIR.'/config/database.bak.php')) { |
| 208 | 208 | echo '<p class="alert alert-danger"><strong>Error:</strong> The backup file ../config/database.bak.php '. |
| 209 | - 'could not be written. Please correct this!</p>'; |
|
| 209 | + 'could not be written. Please correct this!</p>'; |
|
| 210 | 210 | } else { |
| 211 | 211 | $checkDatabaseSetupFile = true; |
| 212 | 212 | $updateMessages[] = 'A backup of your database configuration file has been made.'; |
@@ -603,8 +603,8 @@ discard block |
||
| 603 | 603 | if (!$result) { |
| 604 | 604 | echo '</div>'; |
| 605 | 605 | echo '<p class="alert alert-danger"><strong>Error:</strong> Please update your version of phpMyFAQ '. |
| 606 | - 'once again or send us a <a href="http://bugs.phpmyfaq.de" target="_blank">bug report</a>.'. |
|
| 607 | - '</p>'; |
|
| 606 | + 'once again or send us a <a href="http://bugs.phpmyfaq.de" target="_blank">bug report</a>.'. |
|
| 607 | + '</p>'; |
|
| 608 | 608 | printf( |
| 609 | 609 | '<p class="alert alert-danger"><strong>DB error:</strong> %s</p>', |
| 610 | 610 | $faqConfig->getDb()->error() |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | printf('<span title="%s"><i aria-hidden="true" class="fa fa-circle"></i></span>', $executeQuery); |
| 907 | 907 | if (!$result) { |
| 908 | 908 | echo '<p class="alert alert-danger"><strong>Error:</strong> Please install your version of phpMyFAQ once again '. |
| 909 | - 'or send us a <a href="http://bugs.phpmyfaq.de" target="_blank">bug report</a>.</p>'; |
|
| 909 | + 'or send us a <a href="http://bugs.phpmyfaq.de" target="_blank">bug report</a>.</p>'; |
|
| 910 | 910 | printf('<p class="error"><strong>DB error:</strong> %s</p>', $faqConfig->getDb()->error()); |
| 911 | 911 | printf('<code>%s</code>', htmlentities($executeQuery)); |
| 912 | 912 | PMF_System::renderFooter(); |
@@ -71,9 +71,9 @@ |
||
| 71 | 71 | </a> | |
| 72 | 72 | <?php echo $date->format(date('Y-m-d H:i', $faqcomment['date'])) ?> | |
| 73 | 73 | <a href="<?php printf('../?action=artikel&cat=%d&id=%d&artlang=%s', |
| 74 | - $faqcomment['category_id'], |
|
| 75 | - $faqcomment['record_id'], |
|
| 76 | - $LANGCODE) ?>"> |
|
| 74 | + $faqcomment['category_id'], |
|
| 75 | + $faqcomment['record_id'], |
|
| 76 | + $LANGCODE) ?>"> |
|
| 77 | 77 | <?php echo $faq->getRecordTitle($faqcomment['record_id']) ?> |
| 78 | 78 | </a> |
| 79 | 79 | </span><br/> |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | if (!is_dir(PMF_ROOT_DIR.'/images')) { |
| 67 | 67 | echo '<p class="alert alert-danger">'.sprintf($PMF_LANG['ad_dir_missing'], '/images').'</p>'; |
| 68 | 68 | } else { |
| 69 | - $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(PMF_ROOT_DIR . '/images/')); |
|
| 69 | + $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(PMF_ROOT_DIR.'/images/')); |
|
| 70 | 70 | foreach ($files as $file) { |
| 71 | 71 | if ($file->isDir() || !in_array($file->getExtension(), $allowedExtensions)) { |
| 72 | 72 | continue; |
@@ -74,9 +74,9 @@ discard block |
||
| 74 | 74 | $path = str_replace(dirname(__DIR__).'/', '', $file->getPath()); |
| 75 | 75 | printf( |
| 76 | 76 | '<div class="mce-file" data-src="%s"><img src="%s" class="mce-file-preview">%s</div>', |
| 77 | - $faqConfig->getDefaultUrl() . $path . '/' . $file->getFilename(), |
|
| 78 | - $faqConfig->getDefaultUrl() . $path . '/' . $file->getFilename(), |
|
| 79 | - $path . '/' . $file->getFilename() |
|
| 77 | + $faqConfig->getDefaultUrl().$path.'/'.$file->getFilename(), |
|
| 78 | + $faqConfig->getDefaultUrl().$path.'/'.$file->getFilename(), |
|
| 79 | + $path.'/'.$file->getFilename() |
|
| 80 | 80 | ); |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -73,21 +73,21 @@ |
||
| 73 | 73 | $search |
| 74 | 74 | ->setTable(PMF_Db::getTablePrefix().'faqdata AS fd') |
| 75 | 75 | ->setResultColumns( |
| 76 | - [ |
|
| 77 | - 'fd.id AS id', |
|
| 78 | - 'fd.lang AS lang', |
|
| 79 | - 'fcr.category_id AS category_id', |
|
| 80 | - 'fd.thema AS question', |
|
| 81 | - 'fd.content AS answer', |
|
| 82 | - 'fd.keywords AS keywords' |
|
| 83 | - ] |
|
| 76 | + [ |
|
| 77 | + 'fd.id AS id', |
|
| 78 | + 'fd.lang AS lang', |
|
| 79 | + 'fcr.category_id AS category_id', |
|
| 80 | + 'fd.thema AS question', |
|
| 81 | + 'fd.content AS answer', |
|
| 82 | + 'fd.keywords AS keywords' |
|
| 83 | + ] |
|
| 84 | 84 | ) |
| 85 | 85 | ->setJoinedTable(PMF_Db::getTablePrefix().'faqcategoryrelations AS fcr') |
| 86 | 86 | ->setJoinedColumns( |
| 87 | - [ |
|
| 87 | + [ |
|
| 88 | 88 | 'fd.id = fcr.record_id', |
| 89 | 89 | 'fd.lang = fcr.record_lang', |
| 90 | - ] |
|
| 90 | + ] |
|
| 91 | 91 | ) |
| 92 | 92 | ->setConditions( |
| 93 | 93 | [ |
@@ -105,9 +105,12 @@ discard block |
||
| 105 | 105 | <?php echo $PMF_LANG['msgEdit'] ?> |
| 106 | 106 | </a> |
| 107 | 107 | </td> |
| 108 | - <?php else: ?> |
|
| 108 | + <?php else { |
|
| 109 | + : ?> |
|
| 109 | 110 | <td><?php echo $PMF_LANG['msgEdit'] ?></td> |
| 110 | - <?php endif; ?> |
|
| 111 | + <?php endif; |
|
| 112 | +} |
|
| 113 | +?> |
|
| 111 | 114 | <?php if ($user->perm->checkRight($user->getUserId(), 'deltranslation') && $showActions): ?> |
| 112 | 115 | <td> |
| 113 | 116 | <a class="btn btn-danger" href="javascript: del('<?php echo $lang ?>');" > |
@@ -115,9 +118,12 @@ discard block |
||
| 115 | 118 | <?php echo $PMF_LANG['msgDelete'] ?> |
| 116 | 119 | </a> |
| 117 | 120 | </td> |
| 118 | - <?php else: ?> |
|
| 121 | + <?php else { |
|
| 122 | + : ?> |
|
| 119 | 123 | <td><?php echo $PMF_LANG['msgDelete'] ?></td> |
| 120 | - <?php endif; ?> |
|
| 124 | + <?php endif; |
|
| 125 | +} |
|
| 126 | +?> |
|
| 121 | 127 | <?php if ($user->perm->checkRight($user->getUserId(), 'edittranslation') && $showActions): ?> |
| 122 | 128 | <td> |
| 123 | 129 | <a class="btn btn-success" href="javascript: sendToTeam('<?php echo $lang ?>');" > |
@@ -125,14 +131,20 @@ discard block |
||
| 125 | 131 | <?php echo $PMF_LANG['msgTransToolSendToTeam'] ?> |
| 126 | 132 | </a> |
| 127 | 133 | </td> |
| 128 | - <?php else: ?> |
|
| 134 | + <?php else { |
|
| 135 | + : ?> |
|
| 129 | 136 | <td><?php echo $PMF_LANG['msgTransToolSendToTeam'] ?></td> |
| 130 | - <?php endif; ?> |
|
| 137 | + <?php endif; |
|
| 138 | +} |
|
| 139 | +?> |
|
| 131 | 140 | <?php if ($isLangFileWritable): ?> |
| 132 | 141 | <td><i aria-hidden="true" class="fa fa-ok-circle"></i> <?php echo $PMF_LANG['msgYes'] ?></td> |
| 133 | - <?php else: ?> |
|
| 142 | + <?php else { |
|
| 143 | + : ?> |
|
| 134 | 144 | <td><i aria-hidden="true" class="fa fa-ban-circle"></i> <?php echo $PMF_LANG['msgNo'] ?></td> |
| 135 | - <?php endif; ?> |
|
| 145 | + <?php endif; |
|
| 146 | +} |
|
| 147 | +?> |
|
| 136 | 148 | <td> |
| 137 | 149 | <?php echo $percents ?>% |
| 138 | 150 | <meter value="<?php echo $percents ?>" max="100" min="0" title="<?php echo $percents ?>%"> |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | * @param array $headers |
| 52 | 52 | * @param string $body |
| 53 | 53 | * |
| 54 | - * @return bool True if successful, false otherwise. |
|
| 54 | + * @return integer True if successful, false otherwise. |
|
| 55 | 55 | */ |
| 56 | 56 | public function send($recipients, Array $headers, $body) |
| 57 | 57 | { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | exit(); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -require __DIR__ . '/../../libs/swiftmailer/swift_required.php'; |
|
| 21 | +require __DIR__.'/../../libs/swiftmailer/swift_required.php'; |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Class PMF_Mail_SwiftSMTP |
@@ -36,41 +36,41 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | switch ($ajaxAction) { |
| 38 | 38 | |
| 39 | - case 'upload': |
|
| 39 | + case 'upload': |
|
| 40 | 40 | |
| 41 | - $uploadDir = PMF_ROOT_DIR . '/images/'; |
|
| 42 | - $uploadFile = basename($_FILES['upload']['name']); |
|
| 43 | - $isUploaded = false; |
|
| 44 | - $height = $width = 0; |
|
| 41 | + $uploadDir = PMF_ROOT_DIR . '/images/'; |
|
| 42 | + $uploadFile = basename($_FILES['upload']['name']); |
|
| 43 | + $isUploaded = false; |
|
| 44 | + $height = $width = 0; |
|
| 45 | 45 | |
| 46 | - if ($csrfOkay) { |
|
| 47 | - if (is_uploaded_file($uploadedFile['tmp_name']) && |
|
| 48 | - $uploadedFile['size'] < $faqConfig->get('records.maxAttachmentSize') |
|
| 49 | - ) { |
|
| 46 | + if ($csrfOkay) { |
|
| 47 | + if (is_uploaded_file($uploadedFile['tmp_name']) && |
|
| 48 | + $uploadedFile['size'] < $faqConfig->get('records.maxAttachmentSize') |
|
| 49 | + ) { |
|
| 50 | 50 | |
| 51 | - $info = getimagesize($uploadedFile['tmp_name']); |
|
| 51 | + $info = getimagesize($uploadedFile['tmp_name']); |
|
| 52 | 52 | |
| 53 | - if (false === $info) { |
|
| 54 | - $isUploaded = false; |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - if (($info[2] !== IMAGETYPE_GIF) && |
|
| 58 | - ($info[2] !== IMAGETYPE_JPEG) && |
|
| 59 | - ($info[2] !== IMAGETYPE_PNG)) { |
|
| 60 | - $isUploaded = false; |
|
| 61 | - } else { |
|
| 62 | - $isUploaded = true; |
|
| 63 | - } |
|
| 53 | + if (false === $info) { |
|
| 54 | + $isUploaded = false; |
|
| 55 | + } |
|
| 64 | 56 | |
| 65 | - if ($info) { |
|
| 66 | - list($width, $height) = $info; |
|
| 67 | - if (move_uploaded_file($uploadedFile['tmp_name'], $uploadDir . $uploadFile)) { |
|
| 68 | - $isUploaded = true; |
|
| 69 | - } else { |
|
| 57 | + if (($info[2] !== IMAGETYPE_GIF) && |
|
| 58 | + ($info[2] !== IMAGETYPE_JPEG) && |
|
| 59 | + ($info[2] !== IMAGETYPE_PNG)) { |
|
| 70 | 60 | $isUploaded = false; |
| 61 | + } else { |
|
| 62 | + $isUploaded = true; |
|
| 71 | 63 | } |
| 72 | - } |
|
| 73 | - ?> |
|
| 64 | + |
|
| 65 | + if ($info) { |
|
| 66 | + list($width, $height) = $info; |
|
| 67 | + if (move_uploaded_file($uploadedFile['tmp_name'], $uploadDir . $uploadFile)) { |
|
| 68 | + $isUploaded = true; |
|
| 69 | + } else { |
|
| 70 | + $isUploaded = false; |
|
| 71 | + } |
|
| 72 | + } |
|
| 73 | + ?> |
|
| 74 | 74 | <script> |
| 75 | 75 | window.parent.window.pmfImageUpload.uploadFinished({ |
| 76 | 76 | filename: '<?php echo $faqConfig->getDefaultUrl() . 'images/' . $uploadFile ?>', |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | }); |
| 82 | 82 | </script> |
| 83 | 83 | <?php |
| 84 | - } else { |
|
| 85 | - ?> |
|
| 84 | + } else { |
|
| 85 | + ?> |
|
| 86 | 86 | <script> |
| 87 | 87 | window.parent.window.pmfImageUpload.uploadFinished({ |
| 88 | 88 | filename: '', |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | }); |
| 94 | 94 | </script> |
| 95 | 95 | <?php |
| 96 | - } |
|
| 97 | - } else { |
|
| 98 | - ?> |
|
| 96 | + } |
|
| 97 | + } else { |
|
| 98 | + ?> |
|
| 99 | 99 | <script> |
| 100 | 100 | window.parent.window.pmfImageUpload.uploadFinished({ |
| 101 | 101 | filename: '', |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | }); |
| 107 | 107 | </script> |
| 108 | 108 | <?php |
| 109 | - } |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - break; |
|
| 111 | + break; |
|
| 112 | 112 | } |
| 113 | 113 | \ No newline at end of file |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | case 'upload': |
| 40 | 40 | |
| 41 | - $uploadDir = PMF_ROOT_DIR . '/images/'; |
|
| 41 | + $uploadDir = PMF_ROOT_DIR.'/images/'; |
|
| 42 | 42 | $uploadFile = basename($_FILES['upload']['name']); |
| 43 | 43 | $isUploaded = false; |
| 44 | 44 | $height = $width = 0; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if ($info) { |
| 66 | 66 | list($width, $height) = $info; |
| 67 | - if (move_uploaded_file($uploadedFile['tmp_name'], $uploadDir . $uploadFile)) { |
|
| 67 | + if (move_uploaded_file($uploadedFile['tmp_name'], $uploadDir.$uploadFile)) { |
|
| 68 | 68 | $isUploaded = true; |
| 69 | 69 | } else { |
| 70 | 70 | $isUploaded = false; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ?> |
| 74 | 74 | <script> |
| 75 | 75 | window.parent.window.pmfImageUpload.uploadFinished({ |
| 76 | - filename: '<?php echo $faqConfig->getDefaultUrl() . 'images/' . $uploadFile ?>', |
|
| 76 | + filename: '<?php echo $faqConfig->getDefaultUrl().'images/'.$uploadFile ?>', |
|
| 77 | 77 | result: '<?php echo $isUploaded ? 'file_uploaded' : 'error' ?>', |
| 78 | 78 | resultCode: '<?php echo $isUploaded ? 'success' : 'failed' ?>', |
| 79 | 79 | height: <?php echo $height ?>, |
@@ -661,14 +661,14 @@ |
||
| 661 | 661 | $PMF_LANG['ad_entry_visibility'] = 'Objavi?'; |
| 662 | 662 | |
| 663 | 663 | // added v2.0.0 - 2006-01-02 by Lars |
| 664 | -$PMF_LANG['ad_user_error_password'] = "Molimo unesite lozinku. "; |
|
| 665 | -$PMF_LANG['ad_user_error_passwordsDontMatch'] = "Lozinke se ne poklapaju. "; |
|
| 666 | -$PMF_LANG['ad_user_error_loginInvalid'] = "Unešeno korisničko ime nije nađeno."; |
|
| 667 | -$PMF_LANG['ad_user_error_noEmail'] = "Unesite važeću email adresu. "; |
|
| 668 | -$PMF_LANG['ad_user_error_noRealName'] = "Unesite Vaše pravo ime. "; |
|
| 669 | -$PMF_LANG['ad_user_error_delete'] = "Korisnički nalog ne može biti izbrisan. "; |
|
| 670 | -$PMF_LANG['ad_user_error_noId'] = "Nije priložen ID. "; |
|
| 671 | -$PMF_LANG['ad_user_error_protectedAccount'] = "Korisnički nalog je zaštićen. "; |
|
| 664 | +$PMF_LANG['ad_user_error_password'] = "Molimo unesite lozinku. "; |
|
| 665 | +$PMF_LANG['ad_user_error_passwordsDontMatch'] = "Lozinke se ne poklapaju. "; |
|
| 666 | +$PMF_LANG['ad_user_error_loginInvalid'] = "Unešeno korisničko ime nije nađeno."; |
|
| 667 | +$PMF_LANG['ad_user_error_noEmail'] = "Unesite važeću email adresu. "; |
|
| 668 | +$PMF_LANG['ad_user_error_noRealName'] = "Unesite Vaše pravo ime. "; |
|
| 669 | +$PMF_LANG['ad_user_error_delete'] = "Korisnički nalog ne može biti izbrisan. "; |
|
| 670 | +$PMF_LANG['ad_user_error_noId'] = "Nije priložen ID. "; |
|
| 671 | +$PMF_LANG['ad_user_error_protectedAccount'] = "Korisnički nalog je zaštićen. "; |
|
| 672 | 672 | $PMF_LANG['ad_user_deleteUser'] = "Obriši korisnika"; |
| 673 | 673 | $PMF_LANG['ad_user_status'] = "Status:"; |
| 674 | 674 | $PMF_LANG['ad_user_lastModified'] = "zadnji put menjano:"; |