Skip to content

Commit 3e74840

Browse files
committed
coding convection fix - no parens on require_once
1 parent 0301194 commit 3e74840

File tree

208 files changed

+559
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+559
-559
lines changed

actions.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
require_once $CFG['hooks']['actions'];
1111
}
1212

13-
require_once("includes/sanitize.php");
13+
require_once "includes/sanitize.php";
1414

1515
if (isset($_GET['greybox'])) {
1616
$isgb = true;
@@ -26,12 +26,12 @@
2626
} else {
2727
$urlmode = 'http://';
2828
}
29-
require_once("includes/password.php");
29+
require_once "includes/password.php";
3030

3131
if (isset($_GET['action']) && $_GET['action']=="newuser") {
3232
$init_session_start = true;
33-
require_once("init_without_validate.php");
34-
require_once("includes/newusercommon.php");
33+
require_once "init_without_validate.php";
34+
require_once "includes/newusercommon.php";
3535
if (!isset($_SESSION['challenge']) || !isset($_POST['challenge']) ||
3636
$_POST['challenge'] !== $_SESSION['challenge'] ||
3737
!empty($_POST['hval']) ||
@@ -179,7 +179,7 @@
179179
$message .= "<p>".sprintf(_("To complete your %s registration, please click on the following link, or copy and paste it into your webbrowser:"),$installname)."</p>\r\n";
180180
$message .= "<a href=\"" . $GLOBALS['basesiteurl'] . "/actions.php?action=confirm&id=$id\">";
181181
$message .= $GLOBALS['basesiteurl'] . "/actions.php?action=confirm&id=$id</a>\r\n";
182-
require_once("./includes/email.php");
182+
require_once "./includes/email.php";
183183
send_email($_POST['email'], $sendfrom, $installname._(' Confirmation'), $message, array(), array(), 10);
184184

185185
require_once "header.php";
@@ -257,7 +257,7 @@
257257
//header('Location: ' . $urlmode . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/index.php");
258258
exit;
259259
} else if (isset($_GET['action']) && $_GET['action']=="confirm") {
260-
require_once("init_without_validate.php");
260+
require_once "init_without_validate.php";
261261

262262
$query = "UPDATE imas_users SET rights=10 WHERE id=:id AND rights=0";
263263
$stm = $DBH->prepare($query);
@@ -275,7 +275,7 @@
275275
exit;
276276
} else if (isset($_GET['action']) && $_GET['action']=="resetpw") {
277277
$init_session_start = true;
278-
require_once("init_without_validate.php");
278+
require_once "init_without_validate.php";
279279
if (isset($_POST['username'])) {
280280
if (!isset($_SESSION['challenge']) || $_POST['challenge'] !== $_SESSION['challenge'] ||
281281
!empty($_POST['terms']) ||
@@ -328,7 +328,7 @@
328328
$message .= "<a href=\"" . $GLOBALS['basesiteurl'] . "/forms.php?action=resetpw&id=$id&code=$code\">";
329329
$message .= $GLOBALS['basesiteurl'] . "/forms.php?action=resetpw&id=$id&code=$code</a>\r\n";
330330

331-
require_once("./includes/email.php");
331+
require_once "./includes/email.php";
332332
send_email($email, $sendfrom, $installname._(' Password Reset Request'), $message, array(), array(), 10);
333333

334334
require_once "header.php";
@@ -383,7 +383,7 @@
383383
exit;
384384
} else if (isset($_GET['action']) && $_GET['action']=="lookupusername") {
385385
$init_session_start = true;
386-
require_once("init_without_validate.php");
386+
require_once "init_without_validate.php";
387387
if (!isset($_SESSION['challenge']) || !isset($_POST['challenge']) || $_POST['challenge'] !== $_SESSION['challenge'] ||
388388
!empty($_POST['terms']) ||
389389
!isset($_SESSION['lookupusernamestart']) || (time() - $_SESSION['lookupusernamestart']) < 3
@@ -421,7 +421,7 @@
421421
}
422422
$message .= "</p><p>"._("If you forgot your password, use the Lost Password link at the login page.")."</p>";
423423

424-
require_once("./includes/email.php");
424+
require_once "./includes/email.php";
425425
send_email($_POST['email'], $sendfrom, $installname._(' Username Request'), $message, array(), array(), 10);
426426
echo $cnt . _(" usernames match this email address and were emailed"),". <a href=\"index.php\">",_("Return to login page"),"</a>";
427427

@@ -441,7 +441,7 @@
441441
}
442442
exit;
443443
} else if (isset($_GET['action']) && $_GET['action']=="checkusername") {
444-
require_once("init_without_validate.php");
444+
require_once "init_without_validate.php";
445445
if (isset($_GET['originalSID']) && $_GET['originalSID']==$_GET['SID']) {
446446
echo "true";
447447
exit;
@@ -477,7 +477,7 @@
477477
$stm->execute(array(':uid'=>$userid, ':newpw'=>$newpw));
478478

479479
if ($_GET['action']=="chgpwd" && time() - $line['lastemail'] > 60) {
480-
require_once("./includes/email.php");
480+
require_once "./includes/email.php";
481481
$message = '<p><b>'._('This is an automated message. Do not reply to this email.').'</b></p>';
482482
$message .= '<p>'.sprintf(_('Hi, your account details on %s were recently changed.'), $installname).' ';
483483
$message .= _('Your password was changed.');
@@ -781,7 +781,7 @@
781781
}
782782
if ($lastmfatype > 0) {
783783
// also check MFA
784-
require_once('includes/GoogleAuthenticator.php');
784+
require_once 'includes/GoogleAuthenticator.php';
785785
$MFA = new GoogleAuthenticator();
786786

787787
if (!$MFA->verifyCode($mfadata['secret'], $_POST['oldmfa'])) {
@@ -825,7 +825,7 @@
825825
if ($_POST['dochgmfa'] > 0) {
826826
if ($lastmfatype == 0) {
827827
//enabling new
828-
require_once('includes/GoogleAuthenticator.php');
828+
require_once 'includes/GoogleAuthenticator.php';
829829
$MFA = new GoogleAuthenticator();
830830
$mfasecret = $_POST['mfasecret'];
831831

@@ -858,7 +858,7 @@
858858
storeUserPrefs();
859859

860860
if (($pwchanged || trim($old_email) != trim($_POST['email'])) && (time() - $lastemail > 60)) {
861-
require_once("./includes/email.php");
861+
require_once "./includes/email.php";
862862
$message = '<p><b>'._('This is an automated message. Do not reply to this email.').'</b></p>';
863863
$message .= '<p>'.sprintf(_('Hi, your account details on %s were recently changed.'), $installname).' ';
864864
if ($old_email != $_POST['email']) {

admin/actions.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
//IMathAS: Admin actions
33
//(c) 2006 David Lippman
44
require_once "../init.php";
5-
require_once("../includes/password.php");
6-
require_once("../includes/TeacherAuditLog.php");
5+
require_once "../includes/password.php";
6+
require_once "../includes/TeacherAuditLog.php";
77

88
//Look to see if a hook file is defined, and include if it is
99
if (isset($CFG['hooks']['admin/actions'])) {
@@ -238,7 +238,7 @@
238238
) {
239239
$allInstrEnroll = array_unique(array_merge($CFG['GEN']['enrollonnewinstructor'] ?? [], $CFG['GEN']['enrolloninstructorapproval'] ?? []));
240240

241-
require_once("../includes/unenroll.php");
241+
require_once "../includes/unenroll.php";
242242
foreach ($allInstrEnroll as $ncid) {
243243
unenrollstu($ncid, array($_GET['id']));
244244
}
@@ -324,7 +324,7 @@
324324
$stm = $DBH->prepare("UPDATE imas_msgs SET deleted=1 WHERE msgfrom=:msgfrom");
325325
$stm->execute(array(':msgfrom'=>$deluid));
326326

327-
require_once("../includes/filehandler.php");
327+
require_once "../includes/filehandler.php";
328328
//delete profile pics
329329
deletecoursefile('userimg_'.$deluid.'.jpg');
330330
deletecoursefile('userimg_sm'.$deluid.'.jpg');
@@ -470,7 +470,7 @@
470470
case "modify":
471471
case "addcourse":
472472
if ($myrights < 40) { echo _("You don't have the authority for this action"); break;}
473-
require_once("../includes/parsedatetime.php");
473+
require_once "../includes/parsedatetime.php";
474474

475475
if (isset($CFG['CPS']['templateoncreate']) && isset($_POST['usetemplate']) && $_POST['usetemplate']>0) {
476476
$coursetocheck = intval($_POST['usetemplate']);
@@ -1114,7 +1114,7 @@ function updateoutcomes(&$arr) {
11141114
if ($myrights <100) { echo "You don't have the authority for this action"; break;}
11151115
$old = time() - 60*60*24*30*$_POST['months'];
11161116
$who = $_POST['who'];
1117-
require_once("../includes/filehandler.php");
1117+
require_once "../includes/filehandler.php";
11181118
if ($who=="students") {
11191119
$sstm = $DBH->prepare("SELECT id FROM imas_users WHERE lastaccess<:old AND (rights=0 OR rights=10)");
11201120
$sstm->execute(array(':old'=>$old));

admin/approvepending2.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
require_once "../init.php";
4-
require_once('../includes/filehandler.php');
4+
require_once '../includes/filehandler.php';
55

66
if ($myrights<100 && ($myspecialrights&64)!=64) {exit;}
77

@@ -48,7 +48,7 @@
4848
$message .= 'you are welcome to reply to this email with additional verification information.</p>';
4949
}
5050

51-
require_once("../includes/email.php");
51+
require_once "../includes/email.php";
5252
send_email(Sanitize::emailAddress($row['email']), !empty($accountapproval)?$accountapproval:$sendfrom,
5353
$installname._(' Account Status'), $message,
5454
!empty($CFG['email']['new_acct_replyto'])?$CFG['email']['new_acct_replyto']:array(),
@@ -84,7 +84,7 @@
8484
$CFG['email']['new_acct_bcclist'] = getDenyBcc();
8585
}
8686

87-
require_once("../includes/email.php");
87+
require_once "../includes/email.php";
8888
send_email(Sanitize::emailAddress($row['email']), !empty($accountapproval)?$accountapproval:$sendfrom,
8989
$installname._(' Account Status'), $message,
9090
!empty($CFG['email']['new_acct_replyto'])?$CFG['email']['new_acct_replyto']:array(),
@@ -152,7 +152,7 @@
152152
$CFG['email']['new_acct_bcclist'] = getApproveBcc();
153153
}
154154

155-
require_once("../includes/email.php");
155+
require_once "../includes/email.php";
156156
send_email($row['email'], !empty($accountapproval)?$accountapproval:$sendfrom,
157157
$installname._(' Account Approval'), $message,
158158
!empty($CFG['email']['new_acct_replyto'])?$CFG['email']['new_acct_replyto']:array(),

admin/bbexport-generate.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
error_reporting(0);
1111
$loadmathfilter = 1;
1212
$loadgraphfilter = 1;
13-
require_once("../includes/filehandler.php");
14-
require_once("../filter/filter.php");
13+
require_once "../includes/filehandler.php";
14+
require_once "../filter/filter.php";
1515
require_once "bbexport-templates.php";
1616
if (substr($mathimgurl,0,4) !== 'http') {
1717
// need to make an absolute url
@@ -394,7 +394,7 @@ function getorg($it,$parent,&$res,$ind, $parentid) {
394394
$stm->execute(array(':id'=>$iteminfo[$item][1]));
395395
$row = $stm->fetch(PDO::FETCH_NUM);
396396
if ($row[8]==-1) {
397-
require_once("../includes/updateptsposs.php");
397+
require_once "../includes/updateptsposs.php";
398398
$row[8] = updatePointsPossible($iteminfo[$item][1], $row[3], $row[2]);
399399
}
400400

admin/ccexport-generate.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
error_reporting(0);
1111
$loadmathfilter = 1;
1212
$loadgraphfilter = 1;
13-
require_once("../filter/filter.php");
14-
require_once("../includes/filehandler.php");
13+
require_once "../filter/filter.php";
14+
require_once "../includes/filehandler.php";
1515
if (substr($mathimgurl,0,4) !== 'http') {
1616
// need to make an absolute url
1717
if (strlen($imasroot) > 0) {
@@ -406,7 +406,7 @@ function getorg($it,$parent,&$res,$ind,$mod_depth) {
406406
$stm->execute(array(':id'=>$iteminfo[$item][1]));
407407
$row = $stm->fetch(PDO::FETCH_NUM);
408408
if ($row[8]==-1) {
409-
require_once("../includes/updateptsposs.php");
409+
require_once "../includes/updateptsposs.php";
410410
$row[8] = updatePointsPossible($iteminfo[$item][1], $row[3], $row[2]);
411411
}
412412
//echo "encoding {$row[0]} as ".htmlentities($row[0],ENT_XML1,'UTF-8',false).'<br/>';

admin/exportitems.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/*** master php includes *******/
1313
require_once "../init.php";
14-
require_once("../includes/filehandler.php");
14+
require_once "../includes/filehandler.php";
1515
require_once "../includes/copyiteminc.php";
1616
require_once "../includes/loaditemshowdata.php";
1717

admin/exportitems2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/*** master php includes *******/
1414
require_once "../init.php";
15-
require_once("../includes/filehandler.php");
15+
require_once "../includes/filehandler.php";
1616
require_once "../includes/copyiteminc.php";
1717
require_once "../includes/loaditemshowdata.php";
1818
require_once "itemexportfields.php";

admin/exportlib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/*** master php includes *******/
1313
require_once "../init.php";
14-
require_once("../includes/filehandler.php");
14+
require_once "../includes/filehandler.php";
1515

1616

1717
/*** pre-html data manipulation, including function code *******/
@@ -311,7 +311,7 @@ function getchildlibs($lib) {
311311

312312
<?php
313313
$select = "all";
314-
require_once("../course/libtree.php");
314+
require_once "../course/libtree.php";
315315
?>
316316
<span class="form">Limit to non-private questions and libs?</span>
317317
<span class="formright">

admin/federatedapi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
$since = intval($_GET['since']);
1212
require_once "../init_without_validate.php";
13-
require_once("../includes/filehandler.php");
13+
require_once "../includes/filehandler.php";
1414

1515
$peerName = Sanitize::stripHtmlTags($_GET['peer']);
1616
$stm = $DBH->prepare("SELECT id,secret FROM imas_federation_peers WHERE peername=:peername");

admin/federationpull.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// when questions are added
77

88
require_once "../init.php";
9-
require_once("../includes/filehandler.php");
9+
require_once "../includes/filehandler.php";
1010

1111
if ($myrights<100) {
1212
echo "Not authorized";

0 commit comments

Comments
 (0)