@@ -65,12 +65,12 @@ |
||
| 65 | 65 | $hashtags = ''; |
| 66 | 66 | |
| 67 | 67 | if ($tags != '') { |
| 68 | - $hashtags = '#' . str_replace(',', ' #', $tags); |
|
| 68 | + $hashtags = '#'.str_replace(',', ' #', $tags); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $message = PMF_String::htmlspecialchars($question); |
| 72 | - $message .= ' ' . $hashtags; |
|
| 73 | - $message .= ' ' . $link; |
|
| 72 | + $message .= ' '.$hashtags; |
|
| 73 | + $message .= ' '.$link; |
|
| 74 | 74 | |
| 75 | 75 | $this->connection->post('statuses/update', array('status' => $message)); |
| 76 | 76 | } |
@@ -59,18 +59,18 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function getImage($email, $params = array()) |
| 61 | 61 | { |
| 62 | - $imageUrl = $this->getUrl() . 'avatar/' . $this->getHash($email); |
|
| 62 | + $imageUrl = $this->getUrl().'avatar/'.$this->getHash($email); |
|
| 63 | 63 | |
| 64 | 64 | $opts = array(); |
| 65 | 65 | |
| 66 | 66 | if (isset($params['default'])) { |
| 67 | - $opts[] = 'default='. $params['default']; |
|
| 67 | + $opts[] = 'default='.$params['default']; |
|
| 68 | 68 | } |
| 69 | 69 | if (isset($params['size'])) { |
| 70 | - $opts[] = 'size='. $params['size']; |
|
| 70 | + $opts[] = 'size='.$params['size']; |
|
| 71 | 71 | } |
| 72 | 72 | if (isset($params['rating'])) { |
| 73 | - $opts[] = 'rating='. $params['rating']; |
|
| 73 | + $opts[] = 'rating='.$params['rating']; |
|
| 74 | 74 | } |
| 75 | 75 | if (isset($params['force_default']) && $params['force_default'] === true) { |
| 76 | 76 | $opts[] = 'forcedefault=y'; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $params['class'] = ''; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - $gravatar = $imageUrl . (sizeof($opts) > 0 ? '?' . implode($opts, '&') : false); |
|
| 82 | + $gravatar = $imageUrl.(sizeof($opts) > 0 ? '?'.implode($opts, '&') : false); |
|
| 83 | 83 | |
| 84 | 84 | return sprintf( |
| 85 | 85 | '<img src="%s" class="%s" alt="Gravatar">', |
@@ -1,21 +1,21 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Service class for Gravatar support |
|
| 4 | - * |
|
| 5 | - * PHP Version 5.3 |
|
| 6 | - * |
|
| 7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | - * |
|
| 11 | - * @category phpMyFAQ |
|
| 12 | - * @package Services |
|
| 13 | - * @author Thorsten Rinne <[email protected]> |
|
| 14 | - * @copyright 2013-2016 phpMyFAQ Team |
|
| 15 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | - * @link http://www.phpmyfaq.de |
|
| 17 | - * @since 2013-01-14 |
|
| 18 | - */ |
|
| 3 | + * Service class for Gravatar support |
|
| 4 | + * |
|
| 5 | + * PHP Version 5.3 |
|
| 6 | + * |
|
| 7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | + * |
|
| 11 | + * @category phpMyFAQ |
|
| 12 | + * @package Services |
|
| 13 | + * @author Thorsten Rinne <[email protected]> |
|
| 14 | + * @copyright 2013-2016 phpMyFAQ Team |
|
| 15 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | + * @link http://www.phpmyfaq.de |
|
| 17 | + * @since 2013-01-14 |
|
| 18 | + */ |
|
| 19 | 19 | |
| 20 | 20 | if (!defined('IS_VALID_PHPMYFAQ')) { |
| 21 | 21 | exit(); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | if (0 == $bots && false == $banned) { |
| 113 | 113 | if (!isset($sid)) { |
| 114 | - $sid = $this->config->getDb()->nextId(PMF_Db::getTablePrefix() . 'faqsessions', 'sid'); |
|
| 114 | + $sid = $this->config->getDb()->nextId(PMF_Db::getTablePrefix().'faqsessions', 'sid'); |
|
| 115 | 115 | // Sanity check: force the session cookie to contains the current $sid |
| 116 | 116 | if (!is_null($sidc) && (!$sidc != $sid)) { |
| 117 | 117 | self::setCookie(self::PMF_COOKIE_NAME_SESSIONID, $sid); |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | $this->config->getDb()->query($query); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - $data = $sid.';' . |
|
| 136 | - str_replace(';', ',', $action) . ';' . |
|
| 137 | - $id . ';' . |
|
| 138 | - $remoteAddr . ';' . |
|
| 139 | - str_replace(';', ',', $_SERVER['QUERY_STRING']) . ';' . |
|
| 140 | - str_replace(';', ',', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '') . ';' . |
|
| 141 | - str_replace(';', ',', urldecode($_SERVER['HTTP_USER_AGENT'])) . ';' . |
|
| 142 | - $_SERVER['REQUEST_TIME'] . ";\n"; |
|
| 143 | - $file = './data/tracking' . date('dmY'); |
|
| 135 | + $data = $sid.';'. |
|
| 136 | + str_replace(';', ',', $action).';'. |
|
| 137 | + $id.';'. |
|
| 138 | + $remoteAddr.';'. |
|
| 139 | + str_replace(';', ',', $_SERVER['QUERY_STRING']).';'. |
|
| 140 | + str_replace(';', ',', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '').';'. |
|
| 141 | + str_replace(';', ',', urldecode($_SERVER['HTTP_USER_AGENT'])).';'. |
|
| 142 | + $_SERVER['REQUEST_TIME'].";\n"; |
|
| 143 | + $file = './data/tracking'.date('dmY'); |
|
| 144 | 144 | file_put_contents($file, $data, FILE_APPEND); |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | |
| 339 | 339 | $timeNow = ($_SERVER['REQUEST_TIME'] - $activityTimeWindow); |
| 340 | 340 | |
| 341 | - if (! $this->config->get('security.enableLoginOnly')) { |
|
| 341 | + if (!$this->config->get('security.enableLoginOnly')) { |
|
| 342 | 342 | // Count all sids within the time window for public installations |
| 343 | 343 | // @todo add a new field in faqsessions in order to find out only sids of anonymous users |
| 344 | 344 | $query = sprintf(" |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * The main User session class |
|
| 4 | - * |
|
| 5 | - * PHP Version 5.3 |
|
| 6 | - * |
|
| 7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | - * |
|
| 11 | - * @category phpMyFAQ |
|
| 12 | - * @package PMF_Session |
|
| 13 | - * @author Thorsten Rinne <[email protected]> |
|
| 14 | - * @copyright 2007-2016 phpMyFAQ Team |
|
| 15 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | - * @link http://www.phpmyfaq.de |
|
| 17 | - * @since 2007-03-31 |
|
| 18 | - */ |
|
| 3 | + * The main User session class |
|
| 4 | + * |
|
| 5 | + * PHP Version 5.3 |
|
| 6 | + * |
|
| 7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | + * |
|
| 11 | + * @category phpMyFAQ |
|
| 12 | + * @package PMF_Session |
|
| 13 | + * @author Thorsten Rinne <[email protected]> |
|
| 14 | + * @copyright 2007-2016 phpMyFAQ Team |
|
| 15 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | + * @link http://www.phpmyfaq.de |
|
| 17 | + * @since 2007-03-31 |
|
| 18 | + */ |
|
| 19 | 19 | |
| 20 | 20 | if (!defined('IS_VALID_PHPMYFAQ')) { |
| 21 | 21 | exit(); |
@@ -170,8 +170,8 @@ discard block |
||
| 170 | 170 | $result = $this->config->getDb()->query($query); |
| 171 | 171 | |
| 172 | 172 | if ($result) { |
| 173 | - $res = $this->config->getDb()->fetchObject($result); |
|
| 174 | - $timestamp = $res->time; |
|
| 173 | + $res = $this->config->getDb()->fetchObject($result); |
|
| 174 | + $timestamp = $res->time; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return $timestamp; |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | while (($row = $this->_config->getDb()->fetchObject($result))) { |
| 107 | 107 | |
| 108 | 108 | $counter++; |
| 109 | - if (($showArchive && ($counter > $this->_config->get('records.numberOfShownNewsEntries'))) || |
|
| 109 | + if (($showArchive && ($counter > $this->_config->get('records.numberOfShownNewsEntries'))) || |
|
| 110 | 110 | ((!$showArchive) && (!$forceConfLimit) && |
| 111 | 111 | ($counter <= $this->_config->get('records.numberOfShownNewsEntries'))) || |
| 112 | 112 | ((!$showArchive) && $forceConfLimit)) { |
@@ -1,22 +1,22 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * The News class for phpMyFAQ news |
|
| 4 | - * |
|
| 5 | - * PHP Version 5.3 |
|
| 6 | - * |
|
| 7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | - * |
|
| 11 | - * @category phpMyFAQ |
|
| 12 | - * @package PMF_News |
|
| 13 | - * @author Thorsten Rinne <[email protected]> |
|
| 14 | - * @author Matteo Scaramuccia <[email protected]> |
|
| 15 | - * @copyright 2006-2016 phpMyFAQ Team |
|
| 16 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 17 | - * @link http://www.phpmyfaq.de |
|
| 18 | - * @since 2006-06-25 |
|
| 19 | - */ |
|
| 3 | + * The News class for phpMyFAQ news |
|
| 4 | + * |
|
| 5 | + * PHP Version 5.3 |
|
| 6 | + * |
|
| 7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | + * |
|
| 11 | + * @category phpMyFAQ |
|
| 12 | + * @package PMF_News |
|
| 13 | + * @author Thorsten Rinne <[email protected]> |
|
| 14 | + * @author Matteo Scaramuccia <[email protected]> |
|
| 15 | + * @copyright 2006-2016 phpMyFAQ Team |
|
| 16 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 17 | + * @link http://www.phpmyfaq.de |
|
| 18 | + * @since 2006-06-25 |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | if (!defined('IS_VALID_PHPMYFAQ')) { |
| 22 | 22 | exit(); |
@@ -42,10 +42,10 @@ discard block |
||
| 42 | 42 | private $_config; |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Language strings |
|
| 46 | - * |
|
| 47 | - * @var string |
|
| 48 | - */ |
|
| 45 | + * Language strings |
|
| 46 | + * |
|
| 47 | + * @var string |
|
| 48 | + */ |
|
| 49 | 49 | private $pmf_lang; |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -152,9 +152,9 @@ discard block |
||
| 152 | 152 | foreach ($news as $item) { |
| 153 | 153 | |
| 154 | 154 | $url = sprintf('%s?action=news&newsid=%d&newslang=%s', |
| 155 | - PMF_Link::getSystemRelativeUri(), |
|
| 156 | - $item['id'], |
|
| 157 | - $item['lang']); |
|
| 155 | + PMF_Link::getSystemRelativeUri(), |
|
| 156 | + $item['id'], |
|
| 157 | + $item['lang']); |
|
| 158 | 158 | $oLink = new PMF_Link($url, $this->_config); |
| 159 | 159 | |
| 160 | 160 | if (isset($item['header'])) { |
@@ -291,10 +291,10 @@ |
||
| 291 | 291 | public function update(Array $newConfigs) |
| 292 | 292 | { |
| 293 | 293 | $runtimeConfigs = array( |
| 294 | - 'core.database', // PMF_DB_Driver |
|
| 295 | - 'core.instance', // PMF_Instance |
|
| 296 | - 'core.language', // Language |
|
| 297 | - 'core.ldap', // PMF_Ldap |
|
| 294 | + 'core.database', // PMF_DB_Driver |
|
| 295 | + 'core.instance', // PMF_Instance |
|
| 296 | + 'core.language', // Language |
|
| 297 | + 'core.ldap', // PMF_Ldap |
|
| 298 | 298 | 'core.ldapConfig' // $PMF_LDAP |
| 299 | 299 | ); |
| 300 | 300 | if (is_array($newConfigs)) { |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * The main class for fetching the configuration, update and delete items. This |
|
| 4 | - * class is also a small Dependency Injection Container for phpMyFAQ. |
|
| 5 | - * |
|
| 6 | - * PHP Version 5.3 |
|
| 7 | - * |
|
| 8 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 9 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 10 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 11 | - * |
|
| 12 | - * @category phpMyFAQ |
|
| 13 | - * @package Configuration |
|
| 14 | - * @author Thorsten Rinne <[email protected]> |
|
| 15 | - * @copyright 2006-2016 phpMyFAQ Team |
|
| 16 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 17 | - * @link http://www.phpmyfaq.de |
|
| 18 | - * @since 2006-01-04 |
|
| 19 | - */ |
|
| 3 | + * The main class for fetching the configuration, update and delete items. This |
|
| 4 | + * class is also a small Dependency Injection Container for phpMyFAQ. |
|
| 5 | + * |
|
| 6 | + * PHP Version 5.3 |
|
| 7 | + * |
|
| 8 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 9 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 10 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 11 | + * |
|
| 12 | + * @category phpMyFAQ |
|
| 13 | + * @package Configuration |
|
| 14 | + * @author Thorsten Rinne <[email protected]> |
|
| 15 | + * @copyright 2006-2016 phpMyFAQ Team |
|
| 16 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 17 | + * @link http://www.phpmyfaq.de |
|
| 18 | + * @since 2006-01-04 |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | if (!defined('IS_VALID_PHPMYFAQ')) { |
| 22 | 22 | exit(); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | exit(); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | -require_once PMF_CONFIG_DIR . '/constants.php'; |
|
| 25 | +require_once PMF_CONFIG_DIR.'/constants.php'; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Export Class |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * XML, XHTML and PDF export - Classes and Functions |
|
| 4 | - * |
|
| 5 | - * PHP Version 5.3 |
|
| 6 | - * |
|
| 7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | - * |
|
| 11 | - * @category phpMyFAQ |
|
| 12 | - * @package Export |
|
| 13 | - * @author Thorsten Rinne <[email protected]> |
|
| 14 | - * @author Matteo Scaramuccia <[email protected]> |
|
| 15 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | - * @copyright 2005-2016 phpMyFAQ Team |
|
| 17 | - * @link http://www.phpmyfaq.de |
|
| 18 | - * @since 2005-11-02 |
|
| 19 | - */ |
|
| 3 | + * XML, XHTML and PDF export - Classes and Functions |
|
| 4 | + * |
|
| 5 | + * PHP Version 5.3 |
|
| 6 | + * |
|
| 7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | + * |
|
| 11 | + * @category phpMyFAQ |
|
| 12 | + * @package Export |
|
| 13 | + * @author Thorsten Rinne <[email protected]> |
|
| 14 | + * @author Matteo Scaramuccia <[email protected]> |
|
| 15 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | + * @copyright 2005-2016 phpMyFAQ Team |
|
| 17 | + * @link http://www.phpmyfaq.de |
|
| 18 | + * @since 2005-11-02 |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | if (!defined('IS_VALID_PHPMYFAQ')) { |
| 22 | 22 | exit(); |
@@ -86,11 +86,11 @@ |
||
| 86 | 86 | public function sendOpenQuestionAnswered($email, $userName, $url) |
| 87 | 87 | { |
| 88 | 88 | $this->mail->addTo($email, $userName); |
| 89 | - $this->mail->subject = $this->config->get('main.titleFAQ') . ' - ' . $this->pmfStr['msgQuestionAnswered']; |
|
| 89 | + $this->mail->subject = $this->config->get('main.titleFAQ').' - '.$this->pmfStr['msgQuestionAnswered']; |
|
| 90 | 90 | $this->mail->message = sprintf( |
| 91 | 91 | $this->pmfStr['msgMessageQuestionAnswered'], |
| 92 | 92 | $this->config->get('main.titleFAQ') |
| 93 | - ) . "\n\r" . $url; |
|
| 93 | + )."\n\r".$url; |
|
| 94 | 94 | $this->mail->send(); |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | \ No newline at end of file |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | public static function selectPerm($permLevel, PMF_Configuration $config) |
| 88 | 88 | { |
| 89 | 89 | if (isset($permLevel)) { |
| 90 | - $permclass = 'PMF_Perm_' . ucfirst(strtolower($permLevel)); |
|
| 90 | + $permclass = 'PMF_Perm_'.ucfirst(strtolower($permLevel)); |
|
| 91 | 91 | if (class_exists($permclass)) { |
| 92 | 92 | return new $permclass($config); |
| 93 | 93 | } |
@@ -1,46 +1,46 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This class manages user permissions and group memberships. |
|
| 4 | - * |
|
| 5 | - * There are three possible extensions of this class: basic, medium and large |
|
| 6 | - * by the classes PMF_PermBasic, PMF_PermMedium and PMF_PermLarge. The classes |
|
| 7 | - * to allow for scalability. This means that PMF_PermMedium is an extend of |
|
| 8 | - * and PMF_PermLarge is an extend of PMF_PermMedium. |
|
| 9 | - * |
|
| 10 | - * The permission type can be selected by calling $perm = Perm(perm_type) or |
|
| 11 | - * static method $perm = Perm::selectPerm(perm_type) where perm_type is |
|
| 12 | - * 'medium' or 'large'. Both ways, a PMF_PermBasic, PMF_PermMedium or |
|
| 13 | - * is returned. |
|
| 14 | - * |
|
| 15 | - * Before calling any method, the object $perm needs to be initialised calling |
|
| 16 | - * user_id, context, context_id). The parameters context and context_id are |
|
| 17 | - * accepted, but do only matter in PMF_PermLarge. In other words, if you have a |
|
| 18 | - * or PMF_PermMedium, it does not matter if you pass context and context_id or |
|
| 19 | - * But in PMF_PermLarge, they do make a significant difference if passed, thus |
|
| 20 | - * for up- and downwards-compatibility. |
|
| 21 | - * |
|
| 22 | - * Perhaps the most important method is $perm->checkRight(right_name). This |
|
| 23 | - * checks whether the user having the user_id set with $perm->setPerm() |
|
| 24 | - * |
|
| 25 | - * The permission object is added to a user using the user's addPerm() method. |
|
| 26 | - * a single permission-object is allowed for each user. The permission-object is |
|
| 27 | - * in the user's $perm variable. Permission methods are performed using the |
|
| 28 | - * variable (e.g. $user->perm->method() ). |
|
| 29 | - * |
|
| 30 | - * PHP Version 5.3 |
|
| 31 | - * |
|
| 32 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 33 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 34 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 35 | - * |
|
| 36 | - * @category phpMyFAQ |
|
| 37 | - * @package Perm |
|
| 38 | - * @author Lars Tiedemann <[email protected]> |
|
| 39 | - * @copyright 2005-2016 phpMyFAQ Team |
|
| 40 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 41 | - * @link http://www.phpmyfaq.de |
|
| 42 | - * @since 2005-09-17 |
|
| 43 | - */ |
|
| 3 | + * This class manages user permissions and group memberships. |
|
| 4 | + * |
|
| 5 | + * There are three possible extensions of this class: basic, medium and large |
|
| 6 | + * by the classes PMF_PermBasic, PMF_PermMedium and PMF_PermLarge. The classes |
|
| 7 | + * to allow for scalability. This means that PMF_PermMedium is an extend of |
|
| 8 | + * and PMF_PermLarge is an extend of PMF_PermMedium. |
|
| 9 | + * |
|
| 10 | + * The permission type can be selected by calling $perm = Perm(perm_type) or |
|
| 11 | + * static method $perm = Perm::selectPerm(perm_type) where perm_type is |
|
| 12 | + * 'medium' or 'large'. Both ways, a PMF_PermBasic, PMF_PermMedium or |
|
| 13 | + * is returned. |
|
| 14 | + * |
|
| 15 | + * Before calling any method, the object $perm needs to be initialised calling |
|
| 16 | + * user_id, context, context_id). The parameters context and context_id are |
|
| 17 | + * accepted, but do only matter in PMF_PermLarge. In other words, if you have a |
|
| 18 | + * or PMF_PermMedium, it does not matter if you pass context and context_id or |
|
| 19 | + * But in PMF_PermLarge, they do make a significant difference if passed, thus |
|
| 20 | + * for up- and downwards-compatibility. |
|
| 21 | + * |
|
| 22 | + * Perhaps the most important method is $perm->checkRight(right_name). This |
|
| 23 | + * checks whether the user having the user_id set with $perm->setPerm() |
|
| 24 | + * |
|
| 25 | + * The permission object is added to a user using the user's addPerm() method. |
|
| 26 | + * a single permission-object is allowed for each user. The permission-object is |
|
| 27 | + * in the user's $perm variable. Permission methods are performed using the |
|
| 28 | + * variable (e.g. $user->perm->method() ). |
|
| 29 | + * |
|
| 30 | + * PHP Version 5.3 |
|
| 31 | + * |
|
| 32 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 33 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 34 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 35 | + * |
|
| 36 | + * @category phpMyFAQ |
|
| 37 | + * @package Perm |
|
| 38 | + * @author Lars Tiedemann <[email protected]> |
|
| 39 | + * @copyright 2005-2016 phpMyFAQ Team |
|
| 40 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 41 | + * @link http://www.phpmyfaq.de |
|
| 42 | + * @since 2005-09-17 |
|
| 43 | + */ |
|
| 44 | 44 | |
| 45 | 45 | if (!defined('IS_VALID_PHPMYFAQ')) { |
| 46 | 46 | exit(); |
@@ -197,11 +197,11 @@ |
||
| 197 | 197 | if ($this->_config->getDb()->numRows($result) > 0) { |
| 198 | 198 | $row = $this->_config->getDb()->fetchObject($result); |
| 199 | 199 | return sprintf( |
| 200 | - ' %s ('.$this->plr->GetMsg('plmsgVotes',$row->usr).')', |
|
| 200 | + ' %s ('.$this->plr->GetMsg('plmsgVotes', $row->usr).')', |
|
| 201 | 201 | round($row->voting, 2) |
| 202 | 202 | ); |
| 203 | 203 | } else { |
| 204 | - return '0 (' . $this->plr->GetMsg('plmsgVotes', 0) . ')'; |
|
| 204 | + return '0 ('.$this->plr->GetMsg('plmsgVotes', 0).')'; |
|
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | } |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * The main Rating class |
|
| 4 | - * |
|
| 5 | - * PHP Version 5.3 |
|
| 6 | - * |
|
| 7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | - * |
|
| 11 | - * @category phpMyFAQ |
|
| 12 | - * @package PMF_Rating |
|
| 13 | - * @author Thorsten Rinne <[email protected]> |
|
| 14 | - * @copyright 2007-2016 phpMyFAQ Team |
|
| 15 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | - * @link http://www.phpmyfaq.de |
|
| 17 | - * @since 2007-03-31 |
|
| 18 | - */ |
|
| 3 | + * The main Rating class |
|
| 4 | + * |
|
| 5 | + * PHP Version 5.3 |
|
| 6 | + * |
|
| 7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
| 8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
| 9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
| 10 | + * |
|
| 11 | + * @category phpMyFAQ |
|
| 12 | + * @package PMF_Rating |
|
| 13 | + * @author Thorsten Rinne <[email protected]> |
|
| 14 | + * @copyright 2007-2016 phpMyFAQ Team |
|
| 15 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
| 16 | + * @link http://www.phpmyfaq.de |
|
| 17 | + * @since 2007-03-31 |
|
| 18 | + */ |
|
| 19 | 19 | |
| 20 | 20 | if (!defined('IS_VALID_PHPMYFAQ')) { |
| 21 | 21 | exit(); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | ); |
| 123 | 123 | break; |
| 124 | 124 | |
| 125 | - default: |
|
| 125 | + default: |
|
| 126 | 126 | $query = sprintf(" |
| 127 | 127 | SELECT |
| 128 | 128 | fd.id AS id, |
@@ -162,12 +162,12 @@ discard block |
||
| 162 | 162 | $result = $this->_config->getDb()->query($query); |
| 163 | 163 | while ($row = $this->_config->getDb()->fetchObject($result)) { |
| 164 | 164 | $ratings[] = array( |
| 165 | - 'id' => $row->id, |
|
| 166 | - 'lang' => $row->lang, |
|
| 167 | - 'category_id' => $row->category_id, |
|
| 168 | - 'question' => $row->question, |
|
| 169 | - 'num' => $row->num, |
|
| 170 | - 'usr' => $row->usr |
|
| 165 | + 'id' => $row->id, |
|
| 166 | + 'lang' => $row->lang, |
|
| 167 | + 'category_id' => $row->category_id, |
|
| 168 | + 'question' => $row->question, |
|
| 169 | + 'num' => $row->num, |
|
| 170 | + 'usr' => $row->usr |
|
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | 173 | |
@@ -200,8 +200,8 @@ discard block |
||
| 200 | 200 | ' %s ('.$this->plr->GetMsg('plmsgVotes',$row->usr).')', |
| 201 | 201 | round($row->voting, 2) |
| 202 | 202 | ); |
| 203 | - } else { |
|
| 203 | + } else { |
|
| 204 | 204 | return '0 (' . $this->plr->GetMsg('plmsgVotes', 0) . ')'; |
| 205 | - } |
|
| 205 | + } |
|
| 206 | 206 | } |
| 207 | 207 | } |