Passed
Push — master ( f1f823...a44753 )
by Goffy
03:59
created
preloads/autoloader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
  * @see http://www.php-fig.org/psr/psr-4/examples/
5 5
  */
6 6
 spl_autoload_register(
7
-    static function ($class) {
7
+    static function($class) {
8 8
         // project-specific namespace prefix
9
-        $prefix = 'XoopsModules\\' . \ucfirst(\basename(\dirname(__DIR__)));
9
+        $prefix = 'XoopsModules\\'.\ucfirst(\basename(\dirname(__DIR__)));
10 10
 
11 11
         // base directory for the namespace prefix
12
-        $baseDir = __DIR__ . '/../class/';
12
+        $baseDir = __DIR__.'/../class/';
13 13
 
14 14
         // does the class use the namespace prefix?
15 15
         $len = mb_strlen($prefix);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         // replace the namespace prefix with the base directory, replace namespace
25 25
         // separators with directory separators in the relative class name, append
26 26
         // with .php
27
-        $file = $baseDir . \str_replace('\\', '/', $relativeClass) . '.php';
27
+        $file = $baseDir.\str_replace('\\', '/', $relativeClass).'.php';
28 28
 
29 29
         // if the file exists, require it
30 30
         if (\file_exists($file)) {
Please login to merge, or discard this patch.
preloads/core.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,6 +28,6 @@
 block discarded – undo
28 28
      */
29 29
     public static function eventCoreIncludeCommonEnd($args)
30 30
     {
31
-        include __DIR__ . '/autoloader.php';
31
+        include __DIR__.'/autoloader.php';
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
readmes.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -45,38 +45,38 @@
 block discarded – undo
45 45
 $GLOBALS['xoopsTpl']->assign('showItem', $rmId > 0);
46 46
 
47 47
 switch ($op) {
48
-	case 'show':
49
-	case 'list':
50
-	default:
51
-		$crReadmes = new \CriteriaCompo();
52
-		if ($rmId > 0) {
53
-			$crReadmes->add(new \Criteria('rm_id', $rmId));
54
-		}
55
-		$readmesCount = $readmesHandler->getCount($crReadmes);
56
-		$GLOBALS['xoopsTpl']->assign('readmesCount', $readmesCount);
57
-		$crReadmes->setStart($start);
58
-		$crReadmes->setLimit($limit);
59
-		$readmesAll = $readmesHandler->getAll($crReadmes);
60
-		if ($readmesCount > 0) {
61
-			$readmes = [];
62
-			// Get All Readmes
63
-			foreach (\array_keys($readmesAll) as $i) {
64
-				$readmes[$i] = $readmesAll[$i]->getValuesReadmes();
65
-				$keywords[$i] = $readmesAll[$i]->getVar('rm_name');
66
-			}
67
-			$GLOBALS['xoopsTpl']->assign('readmes', $readmes);
68
-			unset($readmes);
69
-			// Display Navigation
70
-			if ($readmesCount > $limit) {
71
-				include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
72
-				$pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
73
-				$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
74
-			}
75
-			$GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type'));
76
-			$GLOBALS['xoopsTpl']->assign('divideby', $helper->getConfig('divideby'));
77
-			$GLOBALS['xoopsTpl']->assign('numb_col', $helper->getConfig('numb_col'));
78
-		}
79
-		break;
48
+    case 'show':
49
+    case 'list':
50
+    default:
51
+        $crReadmes = new \CriteriaCompo();
52
+        if ($rmId > 0) {
53
+            $crReadmes->add(new \Criteria('rm_id', $rmId));
54
+        }
55
+        $readmesCount = $readmesHandler->getCount($crReadmes);
56
+        $GLOBALS['xoopsTpl']->assign('readmesCount', $readmesCount);
57
+        $crReadmes->setStart($start);
58
+        $crReadmes->setLimit($limit);
59
+        $readmesAll = $readmesHandler->getAll($crReadmes);
60
+        if ($readmesCount > 0) {
61
+            $readmes = [];
62
+            // Get All Readmes
63
+            foreach (\array_keys($readmesAll) as $i) {
64
+                $readmes[$i] = $readmesAll[$i]->getValuesReadmes();
65
+                $keywords[$i] = $readmesAll[$i]->getVar('rm_name');
66
+            }
67
+            $GLOBALS['xoopsTpl']->assign('readmes', $readmes);
68
+            unset($readmes);
69
+            // Display Navigation
70
+            if ($readmesCount > $limit) {
71
+                include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
72
+                $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
73
+                $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
74
+            }
75
+            $GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type'));
76
+            $GLOBALS['xoopsTpl']->assign('divideby', $helper->getConfig('divideby'));
77
+            $GLOBALS['xoopsTpl']->assign('numb_col', $helper->getConfig('numb_col'));
78
+        }
79
+        break;
80 80
 }
81 81
 
82 82
 // Breadcrumbs
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 use XoopsModules\Wggithub\Constants;
26 26
 use XoopsModules\Wggithub\Common;
27 27
 
28
-require __DIR__ . '/header.php';
28
+require __DIR__.'/header.php';
29 29
 $GLOBALS['xoopsOption']['template_main'] = 'wggithub_readmes.tpl';
30
-include_once XOOPS_ROOT_PATH . '/header.php';
30
+include_once XOOPS_ROOT_PATH.'/header.php';
31 31
 
32 32
 $op    = Request::getCmd('op', 'list');
33 33
 $start = Request::getInt('start', 0);
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 			unset($readmes);
69 69
 			// Display Navigation
70 70
 			if ($readmesCount > $limit) {
71
-				include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
72
-				$pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
71
+				include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
72
+				$pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit='.$limit);
73 73
 				$GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
74 74
 			}
75 75
 			$GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type'));
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 $xoBreadcrumbs[] = ['title' => _MA_WGGITHUB_READMES];
84 84
 
85 85
 // Keywords
86
-wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords));
86
+wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords));
87 87
 unset($keywords);
88 88
 
89 89
 // Description
@@ -91,4 +91,4 @@  discard block
 block discarded – undo
91 91
 $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/readmes.php');
92 92
 $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
93 93
 
94
-require __DIR__ . '/footer.php';
94
+require __DIR__.'/footer.php';
Please login to merge, or discard this patch.
admin/permissions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 use XoopsModules\Wggithub;
25 25
 use XoopsModules\Wggithub\Constants;
26 26
 
27
-require __DIR__ . '/header.php';
27
+require __DIR__.'/header.php';
28 28
 
29 29
 // Template Index
30 30
 $templateMain = 'wggithub_admin_permissions.tpl';
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 $op = Request::getCmd('op', 'global');
34 34
 
35 35
 // Get Form
36
-include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php';
36
+include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';
37 37
 \xoops_load('XoopsFormLoader');
38 38
 
39 39
 $formTitle = \_AM_WGGITHUB_PERMISSIONS_GLOBAL;
@@ -61,4 +61,4 @@  discard block
 block discarded – undo
61 61
     exit();
62 62
 }
63 63
 
64
-require __DIR__ . '/footer.php';
64
+require __DIR__.'/footer.php';
Please login to merge, or discard this patch.
test.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
     Github\Releases,
31 31
 };
32 32
 
33
-require __DIR__ . '/header.php';
33
+require __DIR__.'/header.php';
34 34
 $GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl';
35
-include_once \XOOPS_ROOT_PATH . '/header.php';
35
+include_once \XOOPS_ROOT_PATH.'/header.php';
36 36
 // Define Stylesheet
37 37
 $GLOBALS['xoTheme']->addStylesheet($style, null);
38 38
 $keywords = [];
@@ -165,4 +165,4 @@  discard block
 block discarded – undo
165 165
 var_dump($result);
166 166
 */
167 167
 
168
-require __DIR__ . '/footer.php';
168
+require __DIR__.'/footer.php';
Please login to merge, or discard this patch.
testdata/index.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
     Utility
25 25
 };
26 26
 
27
-require_once dirname(__DIR__, 3) . '/include/cp_header.php';
28
-require \dirname(__DIR__) . '/preloads/autoloader.php';
27
+require_once dirname(__DIR__, 3).'/include/cp_header.php';
28
+require \dirname(__DIR__).'/preloads/autoloader.php';
29 29
 
30 30
 $op = \Xmf\Request::getCmd('op', '');
31 31
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             loadSampleData();
46 46
         } else {
47 47
             xoops_cp_header();
48
-            xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', \sprintf(\constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA_OK')), \constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true);
48
+            xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', \sprintf(\constant('CO_'.$moduleDirNameUpper.'_'.'ADD_SAMPLEDATA_OK')), \constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true);
49 49
             xoops_cp_footer();
50 50
         }
51 51
         break;
@@ -68,20 +68,20 @@  discard block
 block discarded – undo
68 68
     $tables = Helper::getHelper($moduleDirName)->getModule()->getInfo('tables');
69 69
 
70 70
     $language = 'english/';
71
-    if (\is_dir(__DIR__ . '/' . $xoopsConfig['language'])) {
72
-        $language = $xoopsConfig['language'] . '/';
71
+    if (\is_dir(__DIR__.'/'.$xoopsConfig['language'])) {
72
+        $language = $xoopsConfig['language'].'/';
73 73
     }
74 74
 
75 75
     // load module tables
76 76
     foreach ($tables as $table) {
77
-        $tabledata = Yaml::readWrapped($language . $table . '.yml');
77
+        $tabledata = Yaml::readWrapped($language.$table.'.yml');
78 78
         TableLoad::truncateTable($table);
79 79
         TableLoad::loadTableFromArray($table, $tabledata);
80 80
     }
81 81
 
82 82
     // load permissions
83 83
     $table     = 'group_permission';
84
-    $tabledata = Yaml::readWrapped($language . $table . '.yml');
84
+    $tabledata = Yaml::readWrapped($language.$table.'.yml');
85 85
     $mid       = Helper::getHelper($moduleDirName)->getModule()->getVar('mid');
86 86
     loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid);
87 87
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             $utility::rcopy($src, $dest);
95 95
         }
96 96
     }
97
-    \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS'));
97
+    \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAMPLEDATA_SUCCESS'));
98 98
 }
99 99
 
100 100
 function saveSampleData()
@@ -108,23 +108,23 @@  discard block
 block discarded – undo
108 108
 
109 109
     $tables = Helper::getHelper($moduleDirName)->getModule()->getInfo('tables');
110 110
 
111
-    $languageFolder = __DIR__ . '/' . $xoopsConfig['language'];
112
-    if (!\file_exists($languageFolder . '/')) {
113
-        Utility::createFolder($languageFolder . '/');
111
+    $languageFolder = __DIR__.'/'.$xoopsConfig['language'];
112
+    if (!\file_exists($languageFolder.'/')) {
113
+        Utility::createFolder($languageFolder.'/');
114 114
     }
115
-    $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/';
115
+    $exportFolder = $languageFolder.'/Exports-'.date('Y-m-d-H-i-s').'/';
116 116
     Utility::createFolder($exportFolder);
117 117
 
118 118
     // save module tables
119 119
     foreach ($tables as $table) {
120
-        TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml');
120
+        TableLoad::saveTableToYamlFile($table, $exportFolder.$table.'.yml');
121 121
     }
122 122
 
123 123
     // save permissions
124 124
     $criteria = new \CriteriaCompo();
125 125
     $criteria->add(new \Criteria('gperm_modid', Helper::getHelper($moduleDirName)->getModule()->getVar('mid')));
126 126
     $skipColumns[] = 'gperm_id';
127
-    TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns);
127
+    TableLoad::saveTableToYamlFile('group_permission', $exportFolder.'group_permission.yml', $criteria, $skipColumns);
128 128
     unset($criteria);
129 129
 
130 130
     //  ---  COPY test folder files ---------------
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             Utility::rcopy($src, $dest);
136 136
         }
137 137
     }
138
-    \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS'));
138
+    \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA_SUCCESS'));
139 139
 }
140 140
 
141 141
 function exportSchema()
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         //
151 151
         //        \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS'));
152 152
     } catch (\Exception $e) {
153
-        exit(\constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR'));
153
+        exit(\constant('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR'));
154 154
     }
155 155
 
156 156
 }
157 157
\ No newline at end of file
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
     Github\Releases
31 31
 };
32 32
 
33
-require __DIR__ . '/header.php';
33
+require __DIR__.'/header.php';
34 34
 $GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl';
35
-include_once \XOOPS_ROOT_PATH . '/header.php';
35
+include_once \XOOPS_ROOT_PATH.'/header.php';
36 36
 
37 37
 // Permissions
38 38
 $permGlobalView = $permissionsHandler->getPermGlobalView();
39 39
 if (!$permGlobalView) {
40 40
     $GLOBALS['xoopsTpl']->assign('error', _NOPERM);
41
-    require __DIR__ . '/footer.php';
41
+    require __DIR__.'/footer.php';
42 42
 }
43 43
 $permGlobalRead = $permissionsHandler->getPermGlobalRead();
44 44
 $permReadmeUpdate = $permissionsHandler->getPermReadmeUpdate();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 // Define Stylesheet
54 54
 $GLOBALS['xoTheme']->addStylesheet($style, null);
55
-$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL . '/assets/css/tabs.css', null);
55
+$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL.'/assets/css/tabs.css', null);
56 56
 $keywords = [];
57 57
 // 
58 58
 $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             foreach (\array_keys($directoriesAll) as $i) {
120 120
                 $directories[$i] = $directoriesAll[$i]->getValuesDirectories();
121 121
                 $dirName = $directoriesAll[$i]->getVar('dir_name');
122
-                $dirFilterRelease = (bool)$directoriesAll[$i]->getVar('dir_filterrelease');
122
+                $dirFilterRelease = (bool) $directoriesAll[$i]->getVar('dir_filterrelease');
123 123
                 $repos = [];
124 124
                 if (Constants::DIRECTORY_TYPE_ORG == $directoriesAll[$i]->getVar('dir_type')) {
125 125
                     //$github->readOrgRepositories($dirName, 100, 1);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                 $crRepositories->add(new \Criteria('repo_user', $dirName));
132 132
                 $repositoriesCountTotal = $repositoriesHandler->getCount($crRepositories);
133 133
                 if ('any' === $filterRelease && $dirFilterRelease) {
134
-                    $crRepositories->add(new \Criteria('repo_prerelease', 1) );
134
+                    $crRepositories->add(new \Criteria('repo_prerelease', 1));
135 135
                     $crRepositories->add(new \Criteria('repo_release', 1), 'OR');
136 136
                 }
137 137
                 if ('final' === $filterRelease && $dirFilterRelease) {
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
                 }
189 189
                 $directories[$i]['repos'] = $repos;
190 190
                 $directories[$i]['previousRepos'] = $start > 0;
191
-                $directories[$i]['previousOp'] = '&start=' . ($start - $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby;
191
+                $directories[$i]['previousOp'] = '&start='.($start - $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby;
192 192
                 $directories[$i]['nextRepos'] = ($repositoriesCount - $start) > $limit;
193
-                $directories[$i]['nextOp'] = '&start=' . ($start + $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby;
193
+                $directories[$i]['nextOp'] = '&start='.($start + $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby;
194 194
                 $GLOBALS['xoopsTpl']->assign('start', $start);
195 195
                 $GLOBALS['xoopsTpl']->assign('limit', $limit);
196 196
                 $GLOBALS['xoopsTpl']->assign('menu', $menu);
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
             unset($crDirectories, $directories);
202 202
             // Display Navigation
203 203
             if ($directoriesCount > $limit) {
204
-                include_once \XOOPS_ROOT_PATH . '/class/pagenav.php';
205
-                $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
204
+                include_once \XOOPS_ROOT_PATH.'/class/pagenav.php';
205
+                $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit);
206 206
                 $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
207 207
             }
208 208
             $GLOBALS['xoopsTpl']->assign('lang_thereare', \sprintf(\_MA_WGGITHUB_INDEX_THEREARE, $directoriesCount));
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         // Permissions
216 216
         if (!$permGlobalRead) {
217 217
             $GLOBALS['xoopsTpl']->assign('error', _NOPERM);
218
-            require __DIR__ . '/footer.php';
218
+            require __DIR__.'/footer.php';
219 219
         }
220 220
         executeUpdate();
221 221
         break;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         // Permissions
224 224
         if (!$permReadmeUpdate) {
225 225
             $GLOBALS['xoopsTpl']->assign('error', _NOPERM);
226
-            require __DIR__ . '/footer.php';
226
+            require __DIR__.'/footer.php';
227 227
         }
228 228
         $repoId = Request::getInt('repo_id', 0);
229 229
         $repoUser  = Request::getString('repo_user', 'none');
@@ -236,14 +236,14 @@  discard block
 block discarded – undo
236 236
 // Breadcrumbs
237 237
 $xoBreadcrumbs[] = ['title' => \_MA_WGGITHUB_INDEX];
238 238
 // Keywords
239
-wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords));
239
+wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords));
240 240
 unset($keywords);
241 241
 // Description
242 242
 wggithubMetaDescription(\_MA_WGGITHUB_INDEX_DESC);
243 243
 $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/index.php');
244 244
 $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL);
245 245
 $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
246
-require __DIR__ . '/footer.php';
246
+require __DIR__.'/footer.php';
247 247
 
248 248
 
249 249
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
  *
253 253
  * @return bool
254 254
  */
255
-function executeUpdate(){
255
+function executeUpdate() {
256 256
 
257 257
     $github = Github::getInstance();
258 258
     $helper = Helper::getInstance();
Please login to merge, or discard this patch.
class/Constants.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  */
29 29
 interface Constants
30 30
 {
31
-	// Constants for tables
31
+    // Constants for tables
32 32
     public const TABLE_SETTINGS = 0;
33 33
     public const TABLE_REPOSITORIES = 1;
34 34
     public const TABLE_DIRECTORIES = 2;
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
     public const DIRECTORY_TYPE_USER = 1;
40 40
     public const DIRECTORY_TYPE_ORG  = 2;
41 41
 
42
-	// Constants for status
43
-	public const STATUS_NONE     = 0;
42
+    // Constants for status
43
+    public const STATUS_NONE     = 0;
44 44
     public const STATUS_NEW      = 1;
45 45
     public const STATUS_UPDATED  = 2;
46
-	public const STATUS_UPTODATE = 3;
46
+    public const STATUS_UPTODATE = 3;
47 47
 
48
-	// Constants for permissions
49
-	public const PERM_GLOBAL_NONE   = 0;
50
-	public const PERM_GLOBAL_VIEW   = 1;
51
-	public const PERM_GLOBAL_READ   = 2;
52
-	public const PERM_README_UPDATE = 3;
48
+    // Constants for permissions
49
+    public const PERM_GLOBAL_NONE   = 0;
50
+    public const PERM_GLOBAL_VIEW   = 1;
51
+    public const PERM_GLOBAL_READ   = 2;
52
+    public const PERM_README_UPDATE = 3;
53 53
 
54 54
 }
Please login to merge, or discard this patch.
class/PermissionsHandler.php 1 patch
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -33,110 +33,110 @@
 block discarded – undo
33 33
  */
34 34
 class PermissionsHandler extends \XoopsPersistableObjectHandler
35 35
 {
36
-	/**
37
-	 * Constructor
38
-	 *
39
-	 * @param null
40
-	 */
41
-	public function __construct()
42
-	{
43
-	}
36
+    /**
37
+     * Constructor
38
+     *
39
+     * @param null
40
+     */
41
+    public function __construct()
42
+    {
43
+    }
44 44
 
45
-	/**
46
-	 * @public function getPermGlobalRead
47
-	 * returns global right for reading from github
48
-	 *
49
-	 * @param null
50
-	 * @return bool
51
-	 */
52
-	public function getPermGlobalRead()
53
-	{
54
-		global $xoopsUser, $xoopsModule;
55
-		$currentuid = 0;
56
-		if (isset($xoopsUser) && \is_object($xoopsUser)) {
57
-			if ($xoopsUser->isAdmin($xoopsModule->mid())) {
58
-				return true;
59
-			}
60
-			$currentuid = $xoopsUser->uid();
61
-		}
62
-		$grouppermHandler = \xoops_getHandler('groupperm');
63
-		$mid = $xoopsModule->mid();
64
-		$memberHandler = \xoops_getHandler('member');
65
-		if (0 == $currentuid) {
66
-			$my_group_ids = [XOOPS_GROUP_ANONYMOUS];
67
-		} else {
68
-			$my_group_ids = $memberHandler->getGroupsByUser($currentuid);
69
-		}
70
-		if ($grouppermHandler->checkRight('wggithub_ac', Constants::PERM_GLOBAL_READ, $my_group_ids, $mid)) {
71
-			return true;
72
-		}
73
-		return false;
74
-	}
45
+    /**
46
+     * @public function getPermGlobalRead
47
+     * returns global right for reading from github
48
+     *
49
+     * @param null
50
+     * @return bool
51
+     */
52
+    public function getPermGlobalRead()
53
+    {
54
+        global $xoopsUser, $xoopsModule;
55
+        $currentuid = 0;
56
+        if (isset($xoopsUser) && \is_object($xoopsUser)) {
57
+            if ($xoopsUser->isAdmin($xoopsModule->mid())) {
58
+                return true;
59
+            }
60
+            $currentuid = $xoopsUser->uid();
61
+        }
62
+        $grouppermHandler = \xoops_getHandler('groupperm');
63
+        $mid = $xoopsModule->mid();
64
+        $memberHandler = \xoops_getHandler('member');
65
+        if (0 == $currentuid) {
66
+            $my_group_ids = [XOOPS_GROUP_ANONYMOUS];
67
+        } else {
68
+            $my_group_ids = $memberHandler->getGroupsByUser($currentuid);
69
+        }
70
+        if ($grouppermHandler->checkRight('wggithub_ac', Constants::PERM_GLOBAL_READ, $my_group_ids, $mid)) {
71
+            return true;
72
+        }
73
+        return false;
74
+    }
75 75
 
76
-	/**
77
-	 * @public function permGlobalSubmit
78
-	 * returns right for global view
79
-	 *
80
-	 * @param null
81
-	 * @return bool
82
-	 */
83
-	public function getPermGlobalView()
84
-	{
85
-		global $xoopsUser, $xoopsModule;
76
+    /**
77
+     * @public function permGlobalSubmit
78
+     * returns right for global view
79
+     *
80
+     * @param null
81
+     * @return bool
82
+     */
83
+    public function getPermGlobalView()
84
+    {
85
+        global $xoopsUser, $xoopsModule;
86 86
 
87 87
         if ($this->getPermGlobalRead()) {
88 88
             return true;
89 89
         }
90 90
 
91
-		$currentuid = 0;
92
-		if (isset($xoopsUser) && \is_object($xoopsUser)) {
93
-			if ($xoopsUser->isAdmin($xoopsModule->mid())) {
94
-				return true;
95
-			}
96
-			$currentuid = $xoopsUser->uid();
97
-		}
98
-		$grouppermHandler = \xoops_getHandler('groupperm');
99
-		$mid = $xoopsModule->mid();
100
-		$memberHandler = \xoops_getHandler('member');
101
-		if (0 == $currentuid) {
102
-			$my_group_ids = [XOOPS_GROUP_ANONYMOUS];
103
-		} else {
104
-			$my_group_ids = $memberHandler->getGroupsByUser($currentuid);
105
-		}
106
-		if ($grouppermHandler->checkRight('wggithub_ac', Constants::PERM_GLOBAL_VIEW, $my_group_ids, $mid)) {
107
-			return true;
108
-		}
109
-		return false;
110
-	}
91
+        $currentuid = 0;
92
+        if (isset($xoopsUser) && \is_object($xoopsUser)) {
93
+            if ($xoopsUser->isAdmin($xoopsModule->mid())) {
94
+                return true;
95
+            }
96
+            $currentuid = $xoopsUser->uid();
97
+        }
98
+        $grouppermHandler = \xoops_getHandler('groupperm');
99
+        $mid = $xoopsModule->mid();
100
+        $memberHandler = \xoops_getHandler('member');
101
+        if (0 == $currentuid) {
102
+            $my_group_ids = [XOOPS_GROUP_ANONYMOUS];
103
+        } else {
104
+            $my_group_ids = $memberHandler->getGroupsByUser($currentuid);
105
+        }
106
+        if ($grouppermHandler->checkRight('wggithub_ac', Constants::PERM_GLOBAL_VIEW, $my_group_ids, $mid)) {
107
+            return true;
108
+        }
109
+        return false;
110
+    }
111 111
 
112
-	/**
113
-	 * @public function getPermReadmeUpdate
114
-	 * returns right for updating existing readme
115
-	 *
116
-	 * @param null
117
-	 * @return bool
118
-	 */
119
-	public function getPermReadmeUpdate()
120
-	{
121
-		global $xoopsUser, $xoopsModule;
122
-		$currentuid = 0;
123
-		if (isset($xoopsUser) && \is_object($xoopsUser)) {
124
-			if ($xoopsUser->isAdmin($xoopsModule->mid())) {
125
-				return true;
126
-			}
127
-			$currentuid = $xoopsUser->uid();
128
-		}
129
-		$grouppermHandler = \xoops_getHandler('groupperm');
130
-		$mid = $xoopsModule->mid();
131
-		$memberHandler = \xoops_getHandler('member');
132
-		if (0 == $currentuid) {
133
-			$my_group_ids = [XOOPS_GROUP_ANONYMOUS];
134
-		} else {
135
-			$my_group_ids = $memberHandler->getGroupsByUser($currentuid);
136
-		}
137
-		if ($grouppermHandler->checkRight('wggithub_ac', Constants::PERM_README_UPDATE, $my_group_ids, $mid)) {
138
-			return true;
139
-		}
140
-		return false;
141
-	}
112
+    /**
113
+     * @public function getPermReadmeUpdate
114
+     * returns right for updating existing readme
115
+     *
116
+     * @param null
117
+     * @return bool
118
+     */
119
+    public function getPermReadmeUpdate()
120
+    {
121
+        global $xoopsUser, $xoopsModule;
122
+        $currentuid = 0;
123
+        if (isset($xoopsUser) && \is_object($xoopsUser)) {
124
+            if ($xoopsUser->isAdmin($xoopsModule->mid())) {
125
+                return true;
126
+            }
127
+            $currentuid = $xoopsUser->uid();
128
+        }
129
+        $grouppermHandler = \xoops_getHandler('groupperm');
130
+        $mid = $xoopsModule->mid();
131
+        $memberHandler = \xoops_getHandler('member');
132
+        if (0 == $currentuid) {
133
+            $my_group_ids = [XOOPS_GROUP_ANONYMOUS];
134
+        } else {
135
+            $my_group_ids = $memberHandler->getGroupsByUser($currentuid);
136
+        }
137
+        if ($grouppermHandler->checkRight('wggithub_ac', Constants::PERM_README_UPDATE, $my_group_ids, $mid)) {
138
+            return true;
139
+        }
140
+        return false;
141
+    }
142 142
 }
Please login to merge, or discard this patch.