Test Failed
Pull Request — master (#592)
by Lucio
10:17
created
htdocs/modules/profile/lostpass.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @author              Taiwen Jiang <[email protected]>
18 18
  */
19 19
 
20
-include __DIR__ . '/header.php';
20
+include __DIR__.'/header.php';
21 21
 $email = isset($_GET['email']) ? trim($_GET['email']) : '';
22 22
 $email = isset($_POST['email']) ? trim($_POST['email']) : $email;
23 23
 
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
     $areyou = substr($user->getVar('pass'), 0, 5);
41 41
     if ($code != '' && $areyou == $code) {
42 42
         $newpass     = xoops_makepass();
43
-        $xoopsMailer =& xoops_getMailer();
43
+        $xoopsMailer = & xoops_getMailer();
44 44
         $xoopsMailer->useMail();
45 45
         $xoopsMailer->setTemplate('lostpass2.tpl');
46 46
         $xoopsMailer->assign('SITENAME', $GLOBALS['xoopsConfig']['sitename']);
47 47
         $xoopsMailer->assign('ADMINMAIL', $GLOBALS['xoopsConfig']['adminmail']);
48
-        $xoopsMailer->assign('SITEURL', XOOPS_URL . '/');
48
+        $xoopsMailer->assign('SITEURL', XOOPS_URL.'/');
49 49
         $xoopsMailer->assign('IP', $_SERVER['REMOTE_ADDR']);
50 50
         $xoopsMailer->assign('NEWPWD', $newpass);
51 51
         $xoopsMailer->setToUsers($user);
@@ -66,21 +66,21 @@  discard block
 block discarded – undo
66 66
         if (!$GLOBALS['xoopsDB']->queryF($sql)) {
67 67
             include $GLOBALS['xoops']->path('header.php');
68 68
             echo _US_MAILPWDNG;
69
-            include __DIR__ . '/footer.php';
69
+            include __DIR__.'/footer.php';
70 70
             exit();
71 71
         }
72 72
         redirect_header('user.php', 3, sprintf(_US_PWDMAILED, $user->getVar('uname')), false);
73 73
 
74 74
         // If no Code, send it
75 75
     } else {
76
-        $xoopsMailer =& xoops_getMailer();
76
+        $xoopsMailer = & xoops_getMailer();
77 77
         $xoopsMailer->useMail();
78 78
         $xoopsMailer->setTemplate('lostpass1.tpl');
79 79
         $xoopsMailer->assign('SITENAME', $GLOBALS['xoopsConfig']['sitename']);
80 80
         $xoopsMailer->assign('ADMINMAIL', $GLOBALS['xoopsConfig']['adminmail']);
81
-        $xoopsMailer->assign('SITEURL', XOOPS_URL . '/');
81
+        $xoopsMailer->assign('SITEURL', XOOPS_URL.'/');
82 82
         $xoopsMailer->assign('IP', $_SERVER['REMOTE_ADDR']);
83
-        $xoopsMailer->assign('NEWPWD_LINK', XOOPS_URL . "/modules/profile/lostpass.php?email={$email}&code=" . $areyou);
83
+        $xoopsMailer->assign('NEWPWD_LINK', XOOPS_URL."/modules/profile/lostpass.php?email={$email}&code=".$areyou);
84 84
         $xoopsMailer->setToUsers($user);
85 85
         $xoopsMailer->setFromEmail($GLOBALS['xoopsConfig']['adminmail']);
86 86
         $xoopsMailer->setFromName($GLOBALS['xoopsConfig']['sitename']);
@@ -92,6 +92,6 @@  discard block
 block discarded – undo
92 92
         echo '<h4>';
93 93
         printf(_US_CONFMAIL, $user->getVar('uname'));
94 94
         echo '</h4>';
95
-        include __DIR__ . '/footer.php';
95
+        include __DIR__.'/footer.php';
96 96
     }
97 97
 }
Please login to merge, or discard this patch.
htdocs/modules/profile/search.php 2 patches
Switch Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -34,49 +34,49 @@  discard block
 block discarded – undo
34 34
     'language');
35 35
 
36 36
 switch ($op) {
37
-    default:
38
-    case 'search':
39
-        $xoopsOption['cache_group']   = implode('', $groups);
40
-        $GLOBALS['xoopsOption']['template_main'] = 'profile_search.tpl';
41
-        include $GLOBALS['xoops']->path('header.php');
42
-        $xoBreadcrumbs[] = array('title' => _SEARCH);
43
-        $sortby_arr      = array();
44
-
45
-        // Dynamic fields
46
-        $profile_handler = xoops_getModuleHandler('profile');
47
-        // Get fields
48
-        $fields = $profile_handler->loadFields();
49
-        // Get ids of fields that can be searched
50
-        /* @var  $gperm_handler XoopsGroupPermHandler */
51
-        $gperm_handler     = xoops_getHandler('groupperm');
52
-        $searchable_fields = $gperm_handler->getItemIds('profile_search', $groups, $GLOBALS['xoopsModule']->getVar('mid'));
53
-
54
-        include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
55
-        $searchform = new XoopsThemeForm('', 'searchform', 'search.php', 'post');
56
-
57
-        $name_tray = new XoopsFormElementTray(_US_NICKNAME);
58
-        $name_tray->addElement(new XoopsFormSelectMatchOption('', 'uname_match'));
59
-        $name_tray->addElement(new XoopsFormText('', 'uname', 35, 255));
60
-        $searchform->addElement($name_tray);
61
-
62
-        $email_tray = new XoopsFormElementTray(_US_EMAIL);
63
-        $email_tray->addElement(new XoopsFormSelectMatchOption('', 'email_match'));
64
-        $email_tray->addElement(new XoopsFormText('', 'email', 35, 255));
65
-        $searchform->addElement($email_tray);
66
-
67
-        // add search groups , only for Webmasters
68
-        if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser']->isAdmin()) {
69
-            $group_tray = new XoopsFormElementTray(_US_GROUPS);
70
-            $group_tray->addElement(new XoopsFormSelectGroup('', 'selgroups', null, false, 5, true));
71
-            $searchform->addElement($group_tray);
72
-        }
73
-
74
-        foreach (array_keys($fields) as $i) {
75
-            if (!in_array($fields[$i]->getVar('field_id'), $searchable_fields) || !in_array($fields[$i]->getVar('field_type'), $searchable_types)) {
76
-                continue;
37
+        default:
38
+        case 'search':
39
+            $xoopsOption['cache_group']   = implode('', $groups);
40
+            $GLOBALS['xoopsOption']['template_main'] = 'profile_search.tpl';
41
+            include $GLOBALS['xoops']->path('header.php');
42
+            $xoBreadcrumbs[] = array('title' => _SEARCH);
43
+            $sortby_arr      = array();
44
+
45
+            // Dynamic fields
46
+            $profile_handler = xoops_getModuleHandler('profile');
47
+            // Get fields
48
+            $fields = $profile_handler->loadFields();
49
+            // Get ids of fields that can be searched
50
+            /* @var  $gperm_handler XoopsGroupPermHandler */
51
+            $gperm_handler     = xoops_getHandler('groupperm');
52
+            $searchable_fields = $gperm_handler->getItemIds('profile_search', $groups, $GLOBALS['xoopsModule']->getVar('mid'));
53
+
54
+            include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
55
+            $searchform = new XoopsThemeForm('', 'searchform', 'search.php', 'post');
56
+
57
+            $name_tray = new XoopsFormElementTray(_US_NICKNAME);
58
+            $name_tray->addElement(new XoopsFormSelectMatchOption('', 'uname_match'));
59
+            $name_tray->addElement(new XoopsFormText('', 'uname', 35, 255));
60
+            $searchform->addElement($name_tray);
61
+
62
+            $email_tray = new XoopsFormElementTray(_US_EMAIL);
63
+            $email_tray->addElement(new XoopsFormSelectMatchOption('', 'email_match'));
64
+            $email_tray->addElement(new XoopsFormText('', 'email', 35, 255));
65
+            $searchform->addElement($email_tray);
66
+
67
+            // add search groups , only for Webmasters
68
+            if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser']->isAdmin()) {
69
+                $group_tray = new XoopsFormElementTray(_US_GROUPS);
70
+                $group_tray->addElement(new XoopsFormSelectGroup('', 'selgroups', null, false, 5, true));
71
+                $searchform->addElement($group_tray);
77 72
             }
78
-            $sortby_arr[$i] = $fields[$i]->getVar('field_title');
79
-            switch ($fields[$i]->getVar('field_type')) {
73
+
74
+            foreach (array_keys($fields) as $i) {
75
+                if (!in_array($fields[$i]->getVar('field_id'), $searchable_fields) || !in_array($fields[$i]->getVar('field_type'), $searchable_types)) {
76
+                    continue;
77
+                }
78
+                $sortby_arr[$i] = $fields[$i]->getVar('field_title');
79
+                switch ($fields[$i]->getVar('field_type')) {
80 80
                 case 'textbox':
81 81
                     if ($fields[$i]->getVar('field_valuetype') == XOBJ_DTYPE_INT) {
82 82
                         $searchform->addElement(new XoopsFormText(sprintf(_PROFILE_MA_LARGERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name') . '_larger', 35, 35));
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                     $searchform->addElement($element);
129 129
                     unset($element);
130 130
                     break;
131
-            }
131
+                }
132 132
         }
133 133
         asort($sortby_arr);
134 134
         $sortby_arr    = array_merge(array('' => _NONE, 'uname' => _US_NICKNAME, 'email' => _US_EMAIL), $sortby_arr);
@@ -157,32 +157,32 @@  discard block
 block discarded – undo
157 157
         $GLOBALS['xoopsTpl']->assign('total_users', $total);
158 158
         break;
159 159
 
160
-    case 'results':
161
-        $GLOBALS['xoopsOption']['template_main'] = 'profile_results.tpl';
162
-        include_once $GLOBALS['xoops']->path('header.php');
163
-        $GLOBALS['xoopsTpl']->assign('page_title', _PROFILE_MA_RESULTS);
164
-        $xoBreadcrumbs[] = array(
165
-            'link'  => XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . '/search.php',
166
-            'title' => _SEARCH);
167
-        $xoBreadcrumbs[] = array('title' => _PROFILE_MA_RESULTS);
168
-        /* @var $member_handler XoopsMemberHandler */
169
-        $member_handler = xoops_getHandler('member');
170
-        // Dynamic fields
171
-        $profile_handler = xoops_getModuleHandler('profile');
172
-        // Get fields
173
-        $fields = $profile_handler->loadFields();
174
-        // Get ids of fields that can be searched
175
-        /* @var  $gperm_handler XoopsGroupPermHandler */
176
-        $gperm_handler     = xoops_getHandler('groupperm');
177
-        $searchable_fields = $gperm_handler->getItemIds('profile_search', $groups, $GLOBALS['xoopsModule']->getVar('mid'));
178
-        $searchvars        = array();
179
-        $search_url        = array();
180
-
181
-        $criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
182
-
183
-        if (isset($_REQUEST['uname']) && $_REQUEST['uname'] !== '') {
184
-            $string = $myts->addSlashes(trim($_REQUEST['uname']));
185
-            switch ($_REQUEST['uname_match']) {
160
+        case 'results':
161
+            $GLOBALS['xoopsOption']['template_main'] = 'profile_results.tpl';
162
+            include_once $GLOBALS['xoops']->path('header.php');
163
+            $GLOBALS['xoopsTpl']->assign('page_title', _PROFILE_MA_RESULTS);
164
+            $xoBreadcrumbs[] = array(
165
+                'link'  => XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . '/search.php',
166
+                'title' => _SEARCH);
167
+            $xoBreadcrumbs[] = array('title' => _PROFILE_MA_RESULTS);
168
+            /* @var $member_handler XoopsMemberHandler */
169
+            $member_handler = xoops_getHandler('member');
170
+            // Dynamic fields
171
+            $profile_handler = xoops_getModuleHandler('profile');
172
+            // Get fields
173
+            $fields = $profile_handler->loadFields();
174
+            // Get ids of fields that can be searched
175
+            /* @var  $gperm_handler XoopsGroupPermHandler */
176
+            $gperm_handler     = xoops_getHandler('groupperm');
177
+            $searchable_fields = $gperm_handler->getItemIds('profile_search', $groups, $GLOBALS['xoopsModule']->getVar('mid'));
178
+            $searchvars        = array();
179
+            $search_url        = array();
180
+
181
+            $criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
182
+
183
+            if (isset($_REQUEST['uname']) && $_REQUEST['uname'] !== '') {
184
+                $string = $myts->addSlashes(trim($_REQUEST['uname']));
185
+                switch ($_REQUEST['uname_match']) {
186 186
                 case XOOPS_MATCH_START:
187 187
                     $string .= '%';
188 188
                     break;
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                 case XOOPS_MATCH_CONTAIN:
195 195
                     $string = '%' . $string . '%';
196 196
                     break;
197
-            }
197
+                }
198 198
             $criteria->add(new Criteria('uname', $string, 'LIKE'));
199 199
             $search_url[] = 'uname=' . $_REQUEST['uname'];
200 200
             $search_url[] = 'uname_match=' . $_REQUEST['uname_match'];
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @author              Taiwen Jiang <[email protected]>
18 18
  */
19 19
 
20
-include __DIR__ . '/header.php';
20
+include __DIR__.'/header.php';
21 21
 $myts = MyTextSanitizer::getInstance();
22 22
 
23 23
 $limit_default    = 20;
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 switch ($op) {
37 37
     default:
38 38
     case 'search':
39
-        $xoopsOption['cache_group']   = implode('', $groups);
39
+        $xoopsOption['cache_group'] = implode('', $groups);
40 40
         $GLOBALS['xoopsOption']['template_main'] = 'profile_search.tpl';
41 41
         include $GLOBALS['xoops']->path('header.php');
42 42
         $xoBreadcrumbs[] = array('title' => _SEARCH);
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
             switch ($fields[$i]->getVar('field_type')) {
80 80
                 case 'textbox':
81 81
                     if ($fields[$i]->getVar('field_valuetype') == XOBJ_DTYPE_INT) {
82
-                        $searchform->addElement(new XoopsFormText(sprintf(_PROFILE_MA_LARGERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name') . '_larger', 35, 35));
83
-                        $searchform->addElement(new XoopsFormText(sprintf(_PROFILE_MA_SMALLERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name') . '_smaller', 35, 35));
82
+                        $searchform->addElement(new XoopsFormText(sprintf(_PROFILE_MA_LARGERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name').'_larger', 35, 35));
83
+                        $searchform->addElement(new XoopsFormText(sprintf(_PROFILE_MA_SMALLERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name').'_smaller', 35, 35));
84 84
                     } else {
85 85
                         $tray = new XoopsFormElementTray($fields[$i]->getVar('field_title'));
86
-                        $tray->addElement(new XoopsFormSelectMatchOption('', $fields[$i]->getVar('field_name') . '_match'));
86
+                        $tray->addElement(new XoopsFormSelectMatchOption('', $fields[$i]->getVar('field_name').'_match'));
87 87
                         $tray->addElement(new XoopsFormText('', $fields[$i]->getVar('field_name'), 35, $fields[$i]->getVar('field_maxlength')));
88 88
                         $searchform->addElement($tray);
89 89
                         unset($tray);
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 
112 112
                 case 'date':
113 113
                 case 'datetime':
114
-                    $searchform->addElement(new XoopsFormTextDateSelect(sprintf(_PROFILE_MA_LATERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name') . '_larger', 15, 1));
115
-                    $searchform->addElement(new XoopsFormTextDateSelect(sprintf(_PROFILE_MA_EARLIERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name') . '_smaller', 15, time()));
114
+                    $searchform->addElement(new XoopsFormTextDateSelect(sprintf(_PROFILE_MA_LATERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name').'_larger', 15, 1));
115
+                    $searchform->addElement(new XoopsFormTextDateSelect(sprintf(_PROFILE_MA_EARLIERTHAN, $fields[$i]->getVar('field_title')), $fields[$i]->getVar('field_name').'_smaller', 15, time()));
116 116
                     break;
117 117
 
118 118
                 case 'timezone':
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         include_once $GLOBALS['xoops']->path('header.php');
163 163
         $GLOBALS['xoopsTpl']->assign('page_title', _PROFILE_MA_RESULTS);
164 164
         $xoBreadcrumbs[] = array(
165
-            'link'  => XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . '/search.php',
165
+            'link'  => XOOPS_URL.'/modules/'.$GLOBALS['xoopsModule']->getVar('dirname', 'n').'/search.php',
166 166
             'title' => _SEARCH);
167 167
         $xoBreadcrumbs[] = array('title' => _PROFILE_MA_RESULTS);
168 168
         /* @var $member_handler XoopsMemberHandler */
@@ -188,16 +188,16 @@  discard block
 block discarded – undo
188 188
                     break;
189 189
 
190 190
                 case XOOPS_MATCH_END:
191
-                    $string = '%' . $string;
191
+                    $string = '%'.$string;
192 192
                     break;
193 193
 
194 194
                 case XOOPS_MATCH_CONTAIN:
195
-                    $string = '%' . $string . '%';
195
+                    $string = '%'.$string.'%';
196 196
                     break;
197 197
             }
198 198
             $criteria->add(new Criteria('uname', $string, 'LIKE'));
199
-            $search_url[] = 'uname=' . $_REQUEST['uname'];
200
-            $search_url[] = 'uname_match=' . $_REQUEST['uname_match'];
199
+            $search_url[] = 'uname='.$_REQUEST['uname'];
200
+            $search_url[] = 'uname_match='.$_REQUEST['uname_match'];
201 201
             $searchvars[] = 'uname';
202 202
         }
203 203
         if (isset($_REQUEST['email']) && $_REQUEST['email'] !== '') {
@@ -208,16 +208,16 @@  discard block
 block discarded – undo
208 208
                     break;
209 209
 
210 210
                 case XOOPS_MATCH_END:
211
-                    $string = '%' . $string;
211
+                    $string = '%'.$string;
212 212
                     break;
213 213
 
214 214
                 case XOOPS_MATCH_CONTAIN:
215
-                    $string = '%' . $string . '%';
215
+                    $string = '%'.$string.'%';
216 216
                     break;
217 217
             }
218 218
             $searchvars[] = 'email';
219
-            $search_url[] = 'email=' . $_REQUEST['email'];
220
-            $search_url[] = 'email_match=' . $_REQUEST['email_match'];
219
+            $search_url[] = 'email='.$_REQUEST['email'];
220
+            $search_url[] = 'email_match='.$_REQUEST['email_match'];
221 221
             $criteria->add(new Criteria('email', $string, 'LIKE'));
222 222
             $criteria->add(new Criteria('user_viewemail', 1));
223 223
         }
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
                     case XOBJ_DTYPE_INT:
241 241
                         $value        = array_map('intval', $_REQUEST[$fieldname]);
242 242
                         $searchvars[] = $fieldname;
243
-                        $criteria->add(new Criteria($fieldname, '(' . implode(',', $value) . ')', 'IN'));
243
+                        $criteria->add(new Criteria($fieldname, '('.implode(',', $value).')', 'IN'));
244 244
                         break;
245 245
 
246 246
                     case XOBJ_DTYPE_URL:
@@ -248,11 +248,11 @@  discard block
 block discarded – undo
248 248
                     case XOBJ_DTYPE_TXTAREA:
249 249
                         $value        = array_map(array($GLOBALS['xoopsDB'], 'quoteString'), $_REQUEST[$fieldname]);
250 250
                         $searchvars[] = $fieldname;
251
-                        $criteria->add(new Criteria($fieldname, '(' . implode(',', $value) . ')', 'IN'));
251
+                        $criteria->add(new Criteria($fieldname, '('.implode(',', $value).')', 'IN'));
252 252
                         break;
253 253
                 }
254 254
                 foreach ($_REQUEST[$fieldname] as $value) {
255
-                    $search_url[] = $fieldname . '[]=' . $value;
255
+                    $search_url[] = $fieldname.'[]='.$value;
256 256
                 }
257 257
             } else {
258 258
                 //Other fields (not radio, not select)
@@ -262,55 +262,55 @@  discard block
 block discarded – undo
262 262
                         switch ($fields[$i]->getVar('field_type')) {
263 263
                             case 'date':
264 264
                             case 'datetime':
265
-                                $value = $_REQUEST[$fieldname . '_larger'];
266
-                                if (!($value = strtotime($_REQUEST[$fieldname . '_larger']))) {
267
-                                    $value = (int)$_REQUEST[$fieldname . '_larger'];
265
+                                $value = $_REQUEST[$fieldname.'_larger'];
266
+                                if (!($value = strtotime($_REQUEST[$fieldname.'_larger']))) {
267
+                                    $value = (int)$_REQUEST[$fieldname.'_larger'];
268 268
                                 }
269 269
                                 if ($value > 0) {
270
-                                    $search_url[] = $fieldname . '_larger=' . $value;
270
+                                    $search_url[] = $fieldname.'_larger='.$value;
271 271
                                     $searchvars[] = $fieldname;
272 272
                                     $criteria->add(new Criteria($fieldname, $value, '>='));
273 273
                                 }
274 274
 
275
-                                $value = $_REQUEST[$fieldname . '_smaller'];
276
-                                if (!($value = strtotime($_REQUEST[$fieldname . '_smaller']))) {
277
-                                    $value = (int)$_REQUEST[$fieldname . '_smaller'];
275
+                                $value = $_REQUEST[$fieldname.'_smaller'];
276
+                                if (!($value = strtotime($_REQUEST[$fieldname.'_smaller']))) {
277
+                                    $value = (int)$_REQUEST[$fieldname.'_smaller'];
278 278
                                 }
279 279
                                 if ($value > 0) {
280
-                                    $search_url[] = $fieldname . '_smaller=' . $value;
280
+                                    $search_url[] = $fieldname.'_smaller='.$value;
281 281
                                     $searchvars[] = $fieldname;
282 282
                                     $criteria->add(new Criteria($fieldname, $value + 24 * 3600, '<='));
283 283
                                 }
284 284
                                 break;
285 285
 
286 286
                             default:
287
-                                if (isset($_REQUEST[$fieldname . '_larger']) && (int)$_REQUEST[$fieldname . '_larger'] !== 0) {
288
-                                    $value        = (int)$_REQUEST[$fieldname . '_larger'];
289
-                                    $search_url[] = $fieldname . '_larger=' . $value;
287
+                                if (isset($_REQUEST[$fieldname.'_larger']) && (int)$_REQUEST[$fieldname.'_larger'] !== 0) {
288
+                                    $value        = (int)$_REQUEST[$fieldname.'_larger'];
289
+                                    $search_url[] = $fieldname.'_larger='.$value;
290 290
                                     $searchvars[] = $fieldname;
291 291
                                     $criteria->add(new Criteria($fieldname, $value, '>='));
292 292
                                 }
293 293
 
294
-                                if (isset($_REQUEST[$fieldname . '_smaller']) && (int)$_REQUEST[$fieldname . '_smaller'] !== 0) {
295
-                                    $value        = (int)$_REQUEST[$fieldname . '_smaller'];
296
-                                    $search_url[] = $fieldname . '_smaller=' . $value;
294
+                                if (isset($_REQUEST[$fieldname.'_smaller']) && (int)$_REQUEST[$fieldname.'_smaller'] !== 0) {
295
+                                    $value        = (int)$_REQUEST[$fieldname.'_smaller'];
296
+                                    $search_url[] = $fieldname.'_smaller='.$value;
297 297
                                     $searchvars[] = $fieldname;
298 298
                                     $criteria->add(new Criteria($fieldname, $value, '<='));
299 299
                                 }
300 300
                                 break;
301 301
                         }
302 302
 
303
-                        if (isset($_REQUEST[$fieldname]) && !isset($_REQUEST[$fieldname . '_smaller']) && !isset($_REQUEST[$fieldname . '_larger'])) {
303
+                        if (isset($_REQUEST[$fieldname]) && !isset($_REQUEST[$fieldname.'_smaller']) && !isset($_REQUEST[$fieldname.'_larger'])) {
304 304
                             if (!is_array($_REQUEST[$fieldname])) {
305 305
                                 $value        = (int)$_REQUEST[$fieldname];
306
-                                $search_url[] = $fieldname . '=' . $value;
306
+                                $search_url[] = $fieldname.'='.$value;
307 307
                                 $criteria->add(new Criteria($fieldname, $value, '='));
308 308
                             } else {
309 309
                                 $value = array_map('intval', $_REQUEST[$fieldname]);
310 310
                                 foreach ($value as $thisvalue) {
311
-                                    $search_url[] = $fieldname . '[]=' . $thisvalue;
311
+                                    $search_url[] = $fieldname.'[]='.$thisvalue;
312 312
                                 }
313
-                                $criteria->add(new Criteria($fieldname, '(' . implode(',', $value) . ')', 'IN'));
313
+                                $criteria->add(new Criteria($fieldname, '('.implode(',', $value).')', 'IN'));
314 314
                             }
315 315
 
316 316
                             $searchvars[] = $fieldname;
@@ -322,21 +322,21 @@  discard block
 block discarded – undo
322 322
                     case XOBJ_DTYPE_TXTAREA:
323 323
                         if (isset($_REQUEST[$fieldname]) && $_REQUEST[$fieldname] !== '') {
324 324
                             $value = $myts->addSlashes(trim($_REQUEST[$fieldname]));
325
-                            switch ($_REQUEST[$fieldname . '_match']) {
325
+                            switch ($_REQUEST[$fieldname.'_match']) {
326 326
                                 case XOOPS_MATCH_START:
327 327
                                     $value .= '%';
328 328
                                     break;
329 329
 
330 330
                                 case XOOPS_MATCH_END:
331
-                                    $value = '%' . $value;
331
+                                    $value = '%'.$value;
332 332
                                     break;
333 333
 
334 334
                                 case XOOPS_MATCH_CONTAIN:
335
-                                    $value = '%' . $value . '%';
335
+                                    $value = '%'.$value.'%';
336 336
                                     break;
337 337
                             }
338
-                            $search_url[] = $fieldname . '=' . $_REQUEST[$fieldname];
339
-                            $search_url[] = $fieldname . '_match=' . $_REQUEST[$fieldname . '_match'];
338
+                            $search_url[] = $fieldname.'='.$_REQUEST[$fieldname];
339
+                            $search_url[] = $fieldname.'_match='.$_REQUEST[$fieldname.'_match'];
340 340
                             $operator     = 'LIKE';
341 341
                             $criteria->add(new Criteria($fieldname, $value, $operator));
342 342
                             $searchvars[] = $fieldname;
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
         if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser']->isAdmin()) {
380 380
             $searchgroups = empty($_REQUEST['selgroups']) ? array() : array_map('intval', $_REQUEST['selgroups']);
381 381
             foreach ($searchgroups as $group) {
382
-                $search_url[] = 'selgroups[]=' . $group;
382
+                $search_url[] = 'selgroups[]='.$group;
383 383
             }
384 384
         }
385 385
 
@@ -394,13 +394,13 @@  discard block
 block discarded – undo
394 394
 
395 395
         list($users, $profiles, $total_users) = $profile_handler->search($criteria, $searchvars, $searchgroups);
396 396
 
397
-        $total = sprintf(_PROFILE_MA_FOUNDUSER, "<span class='red'>{$total_users}</span>") . ' ';
397
+        $total = sprintf(_PROFILE_MA_FOUNDUSER, "<span class='red'>{$total_users}</span>").' ';
398 398
         $GLOBALS['xoopsTpl']->assign('total_users', $total);
399 399
 
400 400
         //Sort information
401 401
         foreach (array_keys($users) as $k) {
402 402
             $userarray             = array();
403
-            $userarray['output'][] = "<a href='userinfo.php?uid=" . $users[$k]->getVar('uid') . "' title=''>" . $users[$k]->getVar('uname') . '</a>';
403
+            $userarray['output'][] = "<a href='userinfo.php?uid=".$users[$k]->getVar('uid')."' title=''>".$users[$k]->getVar('uname').'</a>';
404 404
             $userarray['output'][] = ($users[$k]->getVar('user_viewemail') == 1 || (is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->isAdmin())) ? $users[$k]->getVar('email') : '';
405 405
 
406 406
             foreach (array_keys($fields) as $i) {
@@ -424,11 +424,11 @@  discard block
 block discarded – undo
424 424
 
425 425
         if ($total_users > $limit) {
426 426
             $search_url[] = 'op=results';
427
-            $search_url[] = 'order=' . $order;
427
+            $search_url[] = 'order='.$order;
428 428
             //TODO remove it for final release
429 429
             //            $search_url[] = "sortby=" . htmlspecialchars($_REQUEST['sortby']);
430
-            $search_url[] = 'sortby=' . htmlspecialchars($sortby); // change by zyspec
431
-            $search_url[] = 'limit=' . $limit;
430
+            $search_url[] = 'sortby='.htmlspecialchars($sortby); // change by zyspec
431
+            $search_url[] = 'limit='.$limit;
432 432
             if (isset($search_url)) {
433 433
                 $args = implode('&amp;', $search_url);
434 434
             }
@@ -439,4 +439,4 @@  discard block
 block discarded – undo
439 439
         }
440 440
         break;
441 441
 }
442
-include __DIR__ . '/footer.php';
442
+include __DIR__.'/footer.php';
Please login to merge, or discard this patch.
htdocs/modules/profile/preloads/core.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             $op = trim($_GET['op']);
40 40
         }
41 41
         if ($op !== 'login' && (empty($_GET['from']) || 'profile' !== $_GET['from'])) {
42
-            header('location: ./modules/profile/user.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
42
+            header('location: ./modules/profile/user.php'.(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING']));
43 43
             exit();
44 44
         }
45 45
     }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public static function eventCoreEdituserStart($args)
51 51
     {
52
-        header('location: ./modules/profile/edituser.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
52
+        header('location: ./modules/profile/edituser.php'.(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING']));
53 53
         exit();
54 54
     }
55 55
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $email = isset($_GET['email']) ? trim($_GET['email']) : '';
62 62
         $email = isset($_POST['email']) ? trim($_POST['email']) : $email;
63
-        header("location: ./modules/profile/lostpass.php?email={$email}" . (empty($_GET['code']) ? '' : '&' . $_GET['code']));
63
+        header("location: ./modules/profile/lostpass.php?email={$email}".(empty($_GET['code']) ? '' : '&'.$_GET['code']));
64 64
         exit();
65 65
     }
66 66
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public static function eventCoreRegisterStart($args)
71 71
     {
72
-        header('location: ./modules/profile/register.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
72
+        header('location: ./modules/profile/register.php'.(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING']));
73 73
         exit();
74 74
     }
75 75
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public static function eventCoreUserinfoStart($args)
80 80
     {
81
-        header('location: ./modules/profile/userinfo.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
81
+        header('location: ./modules/profile/userinfo.php'.(empty($_SERVER['QUERY_STRING']) ? '' : '?'.$_SERVER['QUERY_STRING']));
82 82
         exit();
83 83
     }
84 84
 }
Please login to merge, or discard this patch.
htdocs/modules/profile/user.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 $xoopsOption['pagetype'] = 'user';
21
-include __DIR__ . '/header.php';
21
+include __DIR__.'/header.php';
22 22
 
23 23
 $op = 'main';
24 24
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $GLOBALS['xoopsTpl']->assign('lang_youremail', _US_YOUREMAIL);
48 48
         $GLOBALS['xoopsTpl']->assign('lang_sendpassword', _US_SENDPASSWORD);
49 49
         $GLOBALS['xoopsTpl']->assign('mailpasswd_token', $GLOBALS['xoopsSecurity']->createToken());
50
-        include __DIR__ . '/footer.php';
50
+        include __DIR__.'/footer.php';
51 51
         exit();
52 52
     }
53 53
     if (!empty($_GET['xoops_redirect'])) {
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
             }
61 61
         }
62 62
         if (!$isExternal) {
63
-            header('Location: ' . $redirect);
63
+            header('Location: '.$redirect);
64 64
             exit();
65 65
         }
66 66
     }
67
-    header('Location: ./userinfo.php?uid=' . $GLOBALS['xoopsUser']->getVar('uid'));
67
+    header('Location: ./userinfo.php?uid='.$GLOBALS['xoopsUser']->getVar('uid'));
68 68
     exit();
69 69
 }
70 70
 
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
     }
89 89
     $xoopsPreload = XoopsPreload::getInstance();
90 90
     $xoopsPreload->triggerEvent('core.behavior.user.logout');
91
-    $message = _US_LOGGEDOUT . '<br>' . _US_THANKYOUFORVISIT;
92
-    redirect_header(XOOPS_URL . '/', 1, $message);
91
+    $message = _US_LOGGEDOUT.'<br>'._US_THANKYOUFORVISIT;
92
+    redirect_header(XOOPS_URL.'/', 1, $message);
93 93
 }
94 94
 
95 95
 if ($op === 'actv') {
@@ -103,18 +103,18 @@  discard block
 block discarded – undo
103 103
     $config_handler             = xoops_getHandler('config');
104 104
     $GLOBALS['xoopsConfigUser'] = $config_handler->getConfigsByCat(XOOPS_CONF_USER);
105 105
     if (!$GLOBALS['xoopsUser'] || $GLOBALS['xoopsConfigUser']['self_delete'] != 1) {
106
-        redirect_header(XOOPS_URL . '/', 5, _US_NOPERMISS);
106
+        redirect_header(XOOPS_URL.'/', 5, _US_NOPERMISS);
107 107
     } else {
108 108
         $groups = $GLOBALS['xoopsUser']->getGroups();
109 109
         if (in_array(XOOPS_GROUP_ADMIN, $groups)) {
110 110
             // users in the webmasters group may not be deleted
111
-            redirect_header(XOOPS_URL . '/', 5, _US_ADMINNO);
111
+            redirect_header(XOOPS_URL.'/', 5, _US_ADMINNO);
112 112
         }
113 113
         $ok = !isset($_POST['ok']) ? 0 : (int)$_POST['ok'];
114 114
         if ($ok != 1) {
115
-            include __DIR__ . '/header.php';
116
-            xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL . '<br>' . _US_REMOVEINFO);
117
-            include __DIR__ . '/footer.php';
115
+            include __DIR__.'/header.php';
116
+            xoops_confirm(array('op' => 'delete', 'ok' => 1), 'user.php', _US_SURETODEL.'<br>'._US_REMOVEINFO);
117
+            include __DIR__.'/footer.php';
118 118
         } else {
119 119
             $del_uid        = $GLOBALS['xoopsUser']->getVar('uid');
120 120
             /* @var $member_handler XoopsMemberHandler */
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
                 $online_handler = xoops_getHandler('online');
125 125
                 $online_handler->destroy($del_uid);
126 126
                 xoops_notification_deletebyuser($del_uid);
127
-                redirect_header(XOOPS_URL . '/', 5, _US_BEENDELED);
127
+                redirect_header(XOOPS_URL.'/', 5, _US_BEENDELED);
128 128
             }
129
-            redirect_header(XOOPS_URL . '/', 5, _US_NOPERMISS);
129
+            redirect_header(XOOPS_URL.'/', 5, _US_NOPERMISS);
130 130
         }
131 131
         exit();
132 132
     }
Please login to merge, or discard this patch.
htdocs/modules/profile/language/english/admin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 define('_PROFILE_AM_PROF_REGISTER', 'Show in registration form');
45 45
 define('_PROFILE_AM_PROF_SEARCH', 'Searchable by these groups');
46 46
 define('_PROFILE_AM_PROF_ACCESS', 'Profile accessible by these groups');
47
-define('_PROFILE_AM_PROF_ACCESS_DESC', '<ul>' . "<li>Admin groups: If a user belongs to admin groups, the current user has access if and only if one of the current user's groups is allowed to access admin group; else</li>" . "<li>Non basic groups: If a user belongs to one or more non basic groups (NOT admin, user, anonymous), the current user has access if and only if one of the current user's groups is allowed to allowed to any of the non basic groups; else</li>" . '<li>User group: If a user belongs to User group only, the current user has access if and only if one of his groups is allowed to access User group</li>' . '</ul>');
47
+define('_PROFILE_AM_PROF_ACCESS_DESC', '<ul>'."<li>Admin groups: If a user belongs to admin groups, the current user has access if and only if one of the current user's groups is allowed to access admin group; else</li>"."<li>Non basic groups: If a user belongs to one or more non basic groups (NOT admin, user, anonymous), the current user has access if and only if one of the current user's groups is allowed to allowed to any of the non basic groups; else</li>".'<li>User group: If a user belongs to User group only, the current user has access if and only if one of his groups is allowed to access User group</li>'.'</ul>');
48 48
 define('_PROFILE_AM_FIELDVISIBLE', 'The field ');
49 49
 define('_PROFILE_AM_FIELDVISIBLEFOR', ' is visible for ');
50 50
 define('_PROFILE_AM_FIELDVISIBLEON', ' viewing a profile of ');
Please login to merge, or discard this patch.
htdocs/modules/profile/include/forms.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 $form->addElement($remove_options);
144 144
             }
145 145
 
146
-            $option_text = "<table  cellspacing='1'><tr><td class='width20'>" . _PROFILE_AM_KEY . '</td><td>' . _PROFILE_AM_VALUE . '</td></tr>';
146
+            $option_text = "<table  cellspacing='1'><tr><td class='width20'>"._PROFILE_AM_KEY.'</td><td>'._PROFILE_AM_VALUE.'</td></tr>';
147 147
             for ($i = 0; $i < 3; ++$i) {
148 148
                 $option_text .= "<tr><td><input type='text' name='addOption[{$i}][key]' id='addOption[{$i}][key]' size='15' /></td><td><input type='text' name='addOption[{$i}][value]' id='addOption[{$i}][value]' size='35' /></td></tr>";
149 149
                 $option_text .= "<tr height='3px'><td colspan='2'> </td></tr>";
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
     if (empty($opkey)) {
286 286
         $opkey = 'profile_opname';
287 287
     }
288
-    $next_opname      = 'op' . mt_rand(10000, 99999);
288
+    $next_opname      = 'op'.mt_rand(10000, 99999);
289 289
     $_SESSION[$opkey] = $next_opname;
290 290
 
291 291
     include_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     }
297 297
     $action    = $_SERVER['REQUEST_URI'];
298 298
     $step_no   = $step['step_no'];
299
-    $use_token = $step['step_no'] > 0;// ? true : false;
299
+    $use_token = $step['step_no'] > 0; // ? true : false;
300 300
     $reg_form  = new XoopsThemeForm($step['step_name'], 'regform', $action, 'post', $use_token);
301 301
 
302 302
     if ($step['step_desc']) {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
     if ($step_no == 1 && $GLOBALS['xoopsConfigUser']['reg_dispdsclmr'] != 0 && $GLOBALS['xoopsConfigUser']['reg_disclaimer'] != '') {
360 360
         $disc_tray = new XoopsFormElementTray(_US_DISCLAIMER, '<br>');
361
-        $disc_text = new XoopsFormLabel('', "<div class=\"pad5\">" . $GLOBALS['myts']->displayTarea($GLOBALS['xoopsConfigUser']['reg_disclaimer'], 1) . '</div>');
361
+        $disc_text = new XoopsFormLabel('', "<div class=\"pad5\">".$GLOBALS['myts']->displayTarea($GLOBALS['xoopsConfigUser']['reg_disclaimer'], 1).'</div>');
362 362
         $disc_tray->addElement($disc_text);
363 363
         $agree_chk = new XoopsFormCheckBox('', 'agree_disc');
364 364
         $agree_chk->addOption(1, _US_IAGREE);
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         //If the user is an admin and is editing someone else
440 440
         $pwd_text  = new XoopsFormPassword('', 'password', 10, 32);
441 441
         $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 32);
442
-        $pwd_tray  = new XoopsFormElementTray(_US_PASSWORD . '<br>' . _US_TYPEPASSTWICE);
442
+        $pwd_tray  = new XoopsFormElementTray(_US_PASSWORD.'<br>'._US_TYPEPASSTWICE);
443 443
         $pwd_tray->addElement($pwd_text);
444 444
         $pwd_tray->addElement($pwd_text2);
445 445
         $elements[0][] = array('element' => $pwd_tray, 'required' => 0); //cannot set an element tray required
Please login to merge, or discard this patch.
htdocs/modules/profile/include/install.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     xoops_loadLanguage('notification');
40 40
     xoops_loadLanguage('main', $module->getVar('dirname', 'n'));
41 41
     include_once $GLOBALS['xoops']->path('include/notification_constants.php');
42
-    $umode_options         = array(
42
+    $umode_options = array(
43 43
         'nest'   => _NESTED,
44 44
         'flat'   => _FLAT,
45 45
         'thread' => _THREADED);
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 {
93 93
     global $module_id;
94 94
 
95
-    $GLOBALS['xoopsDB']->queryF('   INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('profile_profile') . ' (profile_id) ' . '   SELECT uid ' . '   FROM ' . $GLOBALS['xoopsDB']->prefix('users'));
95
+    $GLOBALS['xoopsDB']->queryF('   INSERT INTO '.$GLOBALS['xoopsDB']->prefix('profile_profile').' (profile_id) '.'   SELECT uid '.'   FROM '.$GLOBALS['xoopsDB']->prefix('users'));
96 96
 
97
-    $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('group_permission') . ' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) ' . ' VALUES ' . ' (' . XOOPS_GROUP_ADMIN . ', ' . XOOPS_GROUP_ADMIN . ", {$module_id}, 'profile_access'), " . ' (' . XOOPS_GROUP_ADMIN . ', ' . XOOPS_GROUP_USERS . ", {$module_id}, 'profile_access'), " . ' (' . XOOPS_GROUP_USERS . ', ' . XOOPS_GROUP_USERS . ", {$module_id}, 'profile_access'), " . ' (' . XOOPS_GROUP_ANONYMOUS . ', ' . XOOPS_GROUP_USERS . ", {$module_id}, 'profile_access') " . ' ';
97
+    $sql = 'INSERT INTO '.$GLOBALS['xoopsDB']->prefix('group_permission').' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) '.' VALUES '.' ('.XOOPS_GROUP_ADMIN.', '.XOOPS_GROUP_ADMIN.", {$module_id}, 'profile_access'), ".' ('.XOOPS_GROUP_ADMIN.', '.XOOPS_GROUP_USERS.", {$module_id}, 'profile_access'), ".' ('.XOOPS_GROUP_USERS.', '.XOOPS_GROUP_USERS.", {$module_id}, 'profile_access'), ".' ('.XOOPS_GROUP_ANONYMOUS.', '.XOOPS_GROUP_USERS.", {$module_id}, 'profile_access') ".' ';
98 98
     $GLOBALS['xoopsDB']->queryF($sql);
99 99
 }
100 100
 
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
 {
189 189
     $gperm_itemid = $field_id;
190 190
     $gperm_modid  = $module_id;
191
-    $sql          = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('group_permission') . ' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) ' . ' VALUES ' . ($canedit ? ' (' . XOOPS_GROUP_ADMIN . ", {$gperm_itemid}, {$gperm_modid}, 'profile_edit'), " : '') . ($canedit == 1 ? ' (' . XOOPS_GROUP_USERS . ", {$gperm_itemid}, {$gperm_modid}, 'profile_edit'), " : '') . ' (' . XOOPS_GROUP_ADMIN . ", {$gperm_itemid}, {$gperm_modid}, 'profile_search'), " . ' (' . XOOPS_GROUP_USERS . ", {$gperm_itemid}, {$gperm_modid}, 'profile_search') " . ' ';
191
+    $sql          = 'INSERT INTO '.$GLOBALS['xoopsDB']->prefix('group_permission').' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) '.' VALUES '.($canedit ? ' ('.XOOPS_GROUP_ADMIN.", {$gperm_itemid}, {$gperm_modid}, 'profile_edit'), " : '').($canedit == 1 ? ' ('.XOOPS_GROUP_USERS.", {$gperm_itemid}, {$gperm_modid}, 'profile_edit'), " : '').' ('.XOOPS_GROUP_ADMIN.", {$gperm_itemid}, {$gperm_modid}, 'profile_search'), ".' ('.XOOPS_GROUP_USERS.", {$gperm_itemid}, {$gperm_modid}, 'profile_search') ".' ';
192 192
     $GLOBALS['xoopsDB']->queryF($sql);
193 193
 
194 194
     if ($visible) {
195
-        $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('profile_visibility') . ' (field_id, user_group, profile_group) ' . ' VALUES ' . " ({$gperm_itemid}, " . XOOPS_GROUP_ADMIN . ', ' . XOOPS_GROUP_ADMIN . '), ' . " ({$gperm_itemid}, " . XOOPS_GROUP_ADMIN . ', ' . XOOPS_GROUP_USERS . '), ' . " ({$gperm_itemid}, " . XOOPS_GROUP_USERS . ', ' . XOOPS_GROUP_ADMIN . '), ' . " ({$gperm_itemid}, " . XOOPS_GROUP_USERS . ', ' . XOOPS_GROUP_USERS . '), ' . " ({$gperm_itemid}, " . XOOPS_GROUP_ANONYMOUS . ', ' . XOOPS_GROUP_ADMIN . '), ' . " ({$gperm_itemid}, " . XOOPS_GROUP_ANONYMOUS . ', ' . XOOPS_GROUP_USERS . ')' . ' ';
195
+        $sql = 'INSERT INTO '.$GLOBALS['xoopsDB']->prefix('profile_visibility').' (field_id, user_group, profile_group) '.' VALUES '." ({$gperm_itemid}, ".XOOPS_GROUP_ADMIN.', '.XOOPS_GROUP_ADMIN.'), '." ({$gperm_itemid}, ".XOOPS_GROUP_ADMIN.', '.XOOPS_GROUP_USERS.'), '." ({$gperm_itemid}, ".XOOPS_GROUP_USERS.', '.XOOPS_GROUP_ADMIN.'), '." ({$gperm_itemid}, ".XOOPS_GROUP_USERS.', '.XOOPS_GROUP_USERS.'), '." ({$gperm_itemid}, ".XOOPS_GROUP_ANONYMOUS.', '.XOOPS_GROUP_ADMIN.'), '." ({$gperm_itemid}, ".XOOPS_GROUP_ANONYMOUS.', '.XOOPS_GROUP_USERS.')'.' ';
196 196
         $GLOBALS['xoopsDB']->queryF($sql);
197 197
     }
198 198
 }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
  */
204 204
 function profile_install_addCategory($name, $weight)
205 205
 {
206
-    $GLOBALS['xoopsDB']->query('INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('profile_category') . ' VALUES (0, ' . $GLOBALS['xoopsDB']->quote($name) . ", '', {$weight})");
206
+    $GLOBALS['xoopsDB']->query('INSERT INTO '.$GLOBALS['xoopsDB']->prefix('profile_category').' VALUES (0, '.$GLOBALS['xoopsDB']->quote($name).", '', {$weight})");
207 207
 }
208 208
 
209 209
 /**
@@ -214,5 +214,5 @@  discard block
 block discarded – undo
214 214
  */
215 215
 function profile_install_addStep($name, $desc, $order, $save)
216 216
 {
217
-    $GLOBALS['xoopsDB']->query('INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('profile_regstep') . ' VALUES (0, ' . $GLOBALS['xoopsDB']->quote($name) . ', ' . $GLOBALS['xoopsDB']->quote($desc) . ", {$order}, {$save})");
217
+    $GLOBALS['xoopsDB']->query('INSERT INTO '.$GLOBALS['xoopsDB']->prefix('profile_regstep').' VALUES (0, '.$GLOBALS['xoopsDB']->quote($name).', '.$GLOBALS['xoopsDB']->quote($desc).", {$order}, {$save})");
218 218
 }
Please login to merge, or discard this patch.
htdocs/modules/profile/include/update.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  */
18 18
 
19 19
 $path = dirname(dirname(dirname(__DIR__)));
20
-require_once $path . '/include' . '/cp_header.php';
20
+require_once $path.'/include'.'/cp_header.php';
21 21
 
22 22
 /**
23 23
  * @param      $module
@@ -32,23 +32,23 @@  discard block
 block discarded – undo
32 32
 function xoops_module_update_profile(XoopsModule $module, $oldversion = null)
33 33
 {
34 34
     if ($oldversion < 162) {
35
-        $GLOBALS['xoopsDB']->queryF('UPDATE `' . $GLOBALS['xoopsDB']->prefix('profile_field') . ' SET field_valuetype=2 WHERE field_name=umode');
35
+        $GLOBALS['xoopsDB']->queryF('UPDATE `'.$GLOBALS['xoopsDB']->prefix('profile_field').' SET field_valuetype=2 WHERE field_name=umode');
36 36
     }
37 37
 
38 38
     if ($oldversion < 100) {
39 39
 
40 40
         // Drop old category table
41
-        $sql = 'DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('profile_category');
41
+        $sql = 'DROP TABLE '.$GLOBALS['xoopsDB']->prefix('profile_category');
42 42
         $GLOBALS['xoopsDB']->queryF($sql);
43 43
 
44 44
         // Drop old field-category link table
45
-        $sql = 'DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('profile_fieldcategory');
45
+        $sql = 'DROP TABLE '.$GLOBALS['xoopsDB']->prefix('profile_fieldcategory');
46 46
         $GLOBALS['xoopsDB']->queryF($sql);
47 47
 
48 48
         // Create new tables for new profile module
49
-        $GLOBALS['xoopsDB']->queryFromFile(XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'n') . '/sql/mysql.sql');
49
+        $GLOBALS['xoopsDB']->queryFromFile(XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname', 'n').'/sql/mysql.sql');
50 50
 
51
-        include_once __DIR__ . '/install.php';
51
+        include_once __DIR__.'/install.php';
52 52
         xoops_module_install_profile($module);
53 53
         /* @var $goupperm_handler XoopsGroupPermHandler */
54 54
         $goupperm_handler = xoops_getHandler('groupperm');
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $skip_fields   = $field_handler->getUserVars();
58 58
         $skip_fields[] = 'newemail';
59 59
         $skip_fields[] = 'pm_link';
60
-        $sql           = 'SELECT * FROM `' . $GLOBALS['xoopsDB']->prefix('user_profile_field') . "` WHERE `field_name` NOT IN ('" . implode("', '", $skip_fields) . "')";
60
+        $sql           = 'SELECT * FROM `'.$GLOBALS['xoopsDB']->prefix('user_profile_field')."` WHERE `field_name` NOT IN ('".implode("', '", $skip_fields)."')";
61 61
         $result        = $GLOBALS['xoopsDB']->query($sql);
62 62
         $fields        = array();
63 63
         while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
             $field_handler->insert($object, true);
75 75
 
76 76
             $gperm_itemid = $object->getVar('field_id');
77
-            $sql          = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('group_permission') . ' SET gperm_itemid = ' . $gperm_itemid . '   WHERE gperm_itemid = ' . $myrow['fieldid'] . '       AND gperm_modid = ' . $module->getVar('mid') . "       AND gperm_name IN ('profile_edit', 'profile_search')";
77
+            $sql          = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('group_permission').' SET gperm_itemid = '.$gperm_itemid.'   WHERE gperm_itemid = '.$myrow['fieldid'].'       AND gperm_modid = '.$module->getVar('mid')."       AND gperm_name IN ('profile_edit', 'profile_search')";
78 78
             $GLOBALS['xoopsDB']->queryF($sql);
79 79
 
80 80
             $groups_visible = $goupperm_handler->getGroupIds('profile_visible', $myrow['fieldid'], $module->getVar('mid'));
81 81
             $groups_show    = $goupperm_handler->getGroupIds('profile_show', $myrow['fieldid'], $module->getVar('mid'));
82 82
             foreach ($groups_visible as $ugid) {
83 83
                 foreach ($groups_show as $pgid) {
84
-                    $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('profile_visibility') . ' (field_id, user_group, profile_group) ' . ' VALUES ' . " ({$gperm_itemid}, {$ugid}, {$pgid})";
84
+                    $sql = 'INSERT INTO '.$GLOBALS['xoopsDB']->prefix('profile_visibility').' (field_id, user_group, profile_group) '.' VALUES '." ({$gperm_itemid}, {$ugid}, {$pgid})";
85 85
                     $GLOBALS['xoopsDB']->queryF($sql);
86 86
                 }
87 87
             }
@@ -92,48 +92,48 @@  discard block
 block discarded – undo
92 92
 
93 93
         // Copy data from profile table
94 94
         foreach ($fields as $field) {
95
-            $GLOBALS['xoopsDB']->queryF('UPDATE `' . $GLOBALS['xoopsDB']->prefix('profile_profile') . '` u, `' . $GLOBALS['xoopsDB']->prefix('user_profile') . "` p SET u.{$field} = p.{$field} WHERE u.profile_id=p.profileid");
95
+            $GLOBALS['xoopsDB']->queryF('UPDATE `'.$GLOBALS['xoopsDB']->prefix('profile_profile').'` u, `'.$GLOBALS['xoopsDB']->prefix('user_profile')."` p SET u.{$field} = p.{$field} WHERE u.profile_id=p.profileid");
96 96
         }
97 97
 
98 98
         // Drop old profile table
99
-        $sql = 'DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('user_profile');
99
+        $sql = 'DROP TABLE '.$GLOBALS['xoopsDB']->prefix('user_profile');
100 100
         $GLOBALS['xoopsDB']->queryF($sql);
101 101
 
102 102
         // Drop old field module
103
-        $sql = 'DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('user_profile_field');
103
+        $sql = 'DROP TABLE '.$GLOBALS['xoopsDB']->prefix('user_profile_field');
104 104
         $GLOBALS['xoopsDB']->queryF($sql);
105 105
 
106 106
         // Remove not used items
107
-        $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('group_permission') . '   WHERE `gperm_modid` = ' . $module->getVar('mid') . " AND `gperm_name` IN ('profile_show', 'profile_visible')";
107
+        $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('group_permission').'   WHERE `gperm_modid` = '.$module->getVar('mid')." AND `gperm_name` IN ('profile_show', 'profile_visible')";
108 108
         $GLOBALS['xoopsDB']->queryF($sql);
109 109
     }
110 110
 
111 111
     if ($oldversion < 162) {
112
-        $GLOBALS['xoopsDB']->queryF('UPDATE `' . $GLOBALS['xoopsDB']->prefix('profile_field') . "` SET `field_valuetype`=1 WHERE `field_name`='umode'");
112
+        $GLOBALS['xoopsDB']->queryF('UPDATE `'.$GLOBALS['xoopsDB']->prefix('profile_field')."` SET `field_valuetype`=1 WHERE `field_name`='umode'");
113 113
     }
114 114
 
115 115
     if ($oldversion < 186) {
116 116
         // delete old html template files
117
-        $templateDirectory = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'n') . '/templates/';
117
+        $templateDirectory = XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname', 'n').'/templates/';
118 118
         $template_list     = array_diff(scandir($templateDirectory), array('..', '.'));
119 119
         foreach ($template_list as $k => $v) {
120
-            $fileinfo = new SplFileInfo($templateDirectory . $v);
120
+            $fileinfo = new SplFileInfo($templateDirectory.$v);
121 121
             if ($fileinfo->getExtension() === 'html' && $fileinfo->getFilename() !== 'index.html') {
122
-                @unlink($templateDirectory . $v);
122
+                @unlink($templateDirectory.$v);
123 123
             }
124 124
         }
125 125
 
126 126
         xoops_load('xoopsfile');
127 127
         //delete /images directory
128
-        $imagesDirectory = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'n') . '/images/';
128
+        $imagesDirectory = XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname', 'n').'/images/';
129 129
         $folderHandler   = XoopsFile::getHandler('folder', $imagesDirectory);
130 130
         $folderHandler->delete($imagesDirectory);
131 131
         //delete /templates/style.css file
132
-        $cssFile       = XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname', 'n') . '/templates/style.css';
132
+        $cssFile       = XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname', 'n').'/templates/style.css';
133 133
         $folderHandler = XoopsFile::getHandler('file', $cssFile);
134 134
         $folderHandler->delete($cssFile);
135 135
         //delete .html entries from the tpl table
136
-        $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
136
+        $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'";
137 137
         $GLOBALS['xoopsDB']->queryF($sql);
138 138
     }
139 139
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     $profile_handler->cleanOrphan($GLOBALS['xoopsDB']->prefix('users'), 'uid', 'profile_id');
151 151
     $field_handler = xoops_getModuleHandler('field', $module->getVar('dirname', 'n'));
152 152
     $user_fields   = $field_handler->getUserVars();
153
-    $criteria      = new Criteria('field_name', "('" . implode("', '", $user_fields) . "')", 'IN');
153
+    $criteria      = new Criteria('field_name', "('".implode("', '", $user_fields)."')", 'IN');
154 154
     $field_handler->updateAll('field_config', 0, $criteria);
155 155
 
156 156
     return true;
Please login to merge, or discard this patch.
htdocs/modules/profile/header.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@
 block discarded – undo
18 18
  */
19 19
 
20 20
 $xoopsOption['pagetype'] = 'user';
21
-include dirname(dirname(__DIR__)) . '/mainfile.php';
21
+include dirname(dirname(__DIR__)).'/mainfile.php';
22 22
 $xoopsOption['xoops_module_header'] = '<link rel="stylesheet" type="text/css" href="assets/css/style.css" />';
23 23
 
24 24
 $xoBreadcrumbs   = array();
25 25
 $xoBreadcrumbs[] = array(
26 26
     'title' => $GLOBALS['xoopsModule']->getVar('name'),
27
-    'link' => XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname', 'n') . '/');
27
+    'link' => XOOPS_URL.'/modules/'.$GLOBALS['xoopsModule']->getVar('dirname', 'n').'/');
28 28
 
29 29
 //disable cache
30 30
 $GLOBALS['xoopsConfig']['module_cache'][$GLOBALS['xoopsModule']->getVar('mid')] = 0;
Please login to merge, or discard this patch.