Fixed some php notices

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39034 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-07-19 23:15:05 +00:00
parent fe2314a08e
commit 97ff1db6f9
5 changed files with 9 additions and 7 deletions

View File

@ -179,7 +179,7 @@ class ManifestBuilder {
} else if(substr($item,-4) == '.css') { } else if(substr($item,-4) == '.css') {
$cssName = substr($item, 0, -4); $cssName = substr($item, 0, -4);
Debug::message($item); // Debug::message($item);
if($themeName) { if($themeName) {
$cssManifest[$cssName]['themes'][$themeName] = "$folder/$item"; $cssManifest[$cssName]['themes'][$themeName] = "$folder/$item";

View File

@ -71,7 +71,7 @@ class ErrorPage extends Page {
// Temporarily log out when producing this page // Temporarily log out when producing this page
$loggedInMember = Member::currentUser(); $loggedInMember = Member::currentUser();
Session::clear("loggedInAs"); Session::clear("loggedInAs");
$alc_enc = $_COOKIE['alc_enc']; $alc_enc = isset($_COOKIE['alc_enc']) ? $_COOKIE['alc_enc'] : null;
Cookie::set('alc_enc', null); Cookie::set('alc_enc', null);
// Run the page // Run the page
@ -86,7 +86,9 @@ class ErrorPage extends Page {
// Log back in // Log back in
Session::set("loggedInAs", $loggedInMember->ID); Session::set("loggedInAs", $loggedInMember->ID);
if(isset($alc_enc)) {
Cookie::set('alc_enc', $alc_enc); Cookie::set('alc_enc', $alc_enc);
}
return $this->extension_instances['Versioned']->publish($fromStage, $toStage, $createNewVersion); return $this->extension_instances['Versioned']->publish($fromStage, $toStage, $createNewVersion);
} }

View File

@ -280,7 +280,7 @@ class Versioned extends DataObjectDecorator {
$from = Versioned::get_one_by_stage($this->owner->class, $fromStage, "`{$baseClass}`.ID = {$this->owner->ID}"); $from = Versioned::get_one_by_stage($this->owner->class, $fromStage, "`{$baseClass}`.ID = {$this->owner->ID}");
} }
$publisherID = Member::currentUser()->ID ? Member::currentUser()->ID : 0; $publisherID = isset(Member::currentUser()->ID) ? Member::currentUser()->ID : 0;
if($from) { if($from) {
$from->forceChange(); $from->forceChange();

View File

@ -404,7 +404,7 @@ class Member extends DataObject {
function requireDefaultRecords() { function requireDefaultRecords() {
parent::requireDefaultRecords(); parent::requireDefaultRecords();
if(!DB::query("SELECT * FROM Member")->value() && $_REQUEST['username'] && $_REQUEST['password']) { if(!DB::query("SELECT * FROM Member")->value() && isset($_REQUEST['username']) && isset($_REQUEST['password'])) {
Security::findAnAdministrator($_REQUEST['username'], $_REQUEST['password']); Security::findAnAdministrator($_REQUEST['username'], $_REQUEST['password']);
if(!Database::$supressOutput) { if(!Database::$supressOutput) {

View File

@ -211,7 +211,7 @@ class Security extends Controller {
Permission::grant($adminGroup->ID, "ADMIN"); Permission::grant($adminGroup->ID, "ADMIN");
} }
if(!$member) { if(!isset($member)) {
$member = Object::create('Member'); $member = Object::create('Member');
$member->FirstName = $member->Surname = 'Admin'; $member->FirstName = $member->Surname = 'Admin';
$member->Email = $username; $member->Email = $username;