From f9ade082ba49cf487af31339afa7aeeb0653af57 Mon Sep 17 00:00:00 2001 From: "Justin J. Novack" Date: Mon, 17 Sep 2012 13:42:49 -0400 Subject: [PATCH] PEAR Coding Standards intermediate update for files changed --- src/phorkie/Repository.php | 5 +++++ www/auth.php | 11 ++++------- www/delete.php | 2 +- www/display.php | 2 +- www/edit.php | 2 +- www/forbidden.php | 2 +- www/fork.php | 4 ++-- www/list.php | 2 +- www/new.php | 2 +- www/raw.php | 2 +- www/user.php | 2 +- www/www-header.php | 8 ++++++-- 12 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/phorkie/Repository.php b/src/phorkie/Repository.php index 995a16d..43f2b23 100644 --- a/src/phorkie/Repository.php +++ b/src/phorkie/Repository.php @@ -104,6 +104,11 @@ class Repository $this->hash = $output; } + /** + * Populates $this->message + * + * @return void + */ public function loadMessage() { $rev = (isset($this->hash)) ? $this->hash : 'HEAD'; diff --git a/www/auth.php b/www/auth.php index b8d08ff..1cafd59 100644 --- a/www/auth.php +++ b/www/auth.php @@ -27,7 +27,7 @@ if (isset($_REQUEST['logout'])) { session_destroy(); $redirect = 'http://' . $_SERVER['HTTP_HOST']; header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL)); - exit; + exit; } if (!count($_GET) && !count($_POST)) { @@ -59,9 +59,7 @@ try { exit; } -if (!empty($_POST['disable_associations']) - || !empty($_SESSION['disable_associations'])) { - +if (!empty($_POST['disable_associations']) || !empty($_SESSION['disable_associations'])) { $o->disableAssociations(); $_SESSION['disable_associations'] = true; } @@ -159,8 +157,7 @@ if (isset($_POST['start'])) { $mode = $message->get('openid.mode'); try { - $result = $o->verify(new Net_URL2($returnTo . '?' . $queryString), - $message); + $result = $o->verify(new Net_URL2($returnTo . '?' . $queryString), $message); if ($result->success()) { $status = "Status:SUCCESS!"; @@ -202,7 +199,7 @@ if (isset($_POST['start'])) { $openid = $message->getArrayFormat(); - $email = (isset($openid['openid.ext1.value.email'])) ? $openid['openid.ext1.value.email'] : null; + $email = (isset($openid['openid.ext1.value.email'])) ? $openid['openid.ext1.value.email'] : null; $email = (isset($openid['openid.ext2.value.email']) && !isset($email)) ? $openid['openid.ext2.value.email'] : $email; $email = (isset($openid['openid.sreg.email']) && !isset($email)) ? $openid['openid.sreg.email'] : $email; $email = (isset($openid['openid.ax.value.email']) && !isset($email)) ? $openid['openid.ax.value.email'] : $email; diff --git a/www/delete.php b/www/delete.php index f332028..85f6258 100644 --- a/www/delete.php +++ b/www/delete.php @@ -5,7 +5,7 @@ namespace phorkie; */ require_once 'www-header.php'; if ($GLOBALS['phorkie']['auth']['secure'] > 0) { - require_once 'secure.php'; + include_once 'secure.php'; } $repo = new Repository(); diff --git a/www/display.php b/www/display.php index 2376d30..6f754d9 100644 --- a/www/display.php +++ b/www/display.php @@ -5,7 +5,7 @@ namespace phorkie; */ require_once 'www-header.php'; if ($GLOBALS['phorkie']['auth']['secure'] == 2) { - require_once 'secure.php'; + include_once 'secure.php'; } $repo = new Repository(); diff --git a/www/edit.php b/www/edit.php index db4428b..20e7793 100644 --- a/www/edit.php +++ b/www/edit.php @@ -5,7 +5,7 @@ namespace phorkie; */ require_once 'www-header.php'; if ($GLOBALS['phorkie']['auth']['secure'] > 0) { - require_once 'secure.php'; + include_once 'secure.php'; } $repo = new Repository(); diff --git a/www/forbidden.php b/www/forbidden.php index 1f587a2..3646b0a 100644 --- a/www/forbidden.php +++ b/www/forbidden.php @@ -1,6 +1,6 @@ 0) { - require_once 'secure.php'; + include_once 'secure.php'; } if ($_SERVER['REQUEST_METHOD'] !== 'POST') { @@ -33,4 +33,4 @@ foreach (\glob($new->gitDir . '/hooks/*') as $hookfile) { //FIXME: where to put fork source link? redirect($new->getLink('display')); -?> \ No newline at end of file +?> diff --git a/www/list.php b/www/list.php index 17f46b1..5a394eb 100644 --- a/www/list.php +++ b/www/list.php @@ -5,7 +5,7 @@ namespace phorkie; require_once 'www-header.php'; if ($GLOBALS['phorkie']['auth']['secure'] == 2) { - require_once 'secure.php'; + include_once 'secure.php'; } $rs = new Repositories(); diff --git a/www/new.php b/www/new.php index 8d1a231..0675b4d 100644 --- a/www/new.php +++ b/www/new.php @@ -12,7 +12,7 @@ namespace phorkie; */ require_once 'www-header.php'; if ($GLOBALS['phorkie']['auth']['secure'] > 0) { - require_once 'secure.php'; + include_once 'secure.php'; } $repopo = new Repository_Post(); diff --git a/www/raw.php b/www/raw.php index 67a21ee..6b20633 100644 --- a/www/raw.php +++ b/www/raw.php @@ -5,7 +5,7 @@ namespace phorkie; require_once 'www-header.php'; if ($GLOBALS['phorkie']['auth']['secure'] == 2) { - require_once 'secure.php'; + include_once 'secure.php'; } $repo = new Repository(); $repo->loadFromRequest(); diff --git a/www/user.php b/www/user.php index 1cc8aeb..fd851c4 100644 --- a/www/user.php +++ b/www/user.php @@ -5,7 +5,7 @@ namespace phorkie; require_once 'www-header.php'; if (!isset($_SESSION['identity'])) { - require_once 'secure.php'; + include_once 'secure.php'; } if (isset($_POST['name'])) { diff --git a/www/www-header.php b/www/www-header.php index 5785a3e..64dca11 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -50,8 +50,12 @@ if ($GLOBALS['phorkie']['cfg']['setupcheck']) { // Set/Get git commit session variables $_SESSION['ipaddr'] = $_SERVER['REMOTE_ADDR']; -if (!isset($_SESSION['name'])) { $_SESSION['name'] = $GLOBALS['phorkie']['auth']['anonymousName']; } -if (!isset($_SESSION['email'])) { $_SESSION['email'] = $GLOBALS['phorkie']['auth']['anonymousEmail']; } +if (!isset($_SESSION['name'])) { + $_SESSION['name'] = $GLOBALS['phorkie']['auth']['anonymousName']; +} +if (!isset($_SESSION['email'])) { + $_SESSION['email'] = $GLOBALS['phorkie']['auth']['anonymousEmail']; +} \Twig_Autoloader::register(); -- 2.30.2