diff --git a/core/database.class.php b/core/database.class.php index 2ee4db23..14bac1af 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -271,11 +271,13 @@ class Database { /** * Meta info about the database engine + * @var DBEngine */ private $engine = null; /** * The currently active cache engine + * @var CacheEngine */ public $cache = null; diff --git a/core/extension.class.php b/core/extension.class.php index b288e91f..bce72590 100644 --- a/core/extension.class.php +++ b/core/extension.class.php @@ -140,9 +140,9 @@ abstract class FormatterExtension extends Extension { */ abstract class DataHandlerExtension extends Extension { public function onDataUpload(DataUploadEvent $event) { - global $user; - - if(($supported_ext = $this->supported_ext($event->type)) && ($check_contents = $this->check_contents($event->tmpname))) { + $supported_ext = $this->supported_ext($event->type); + $check_contents = $this->check_contents($event->tmpname); + if($supported_ext && $check_contents) { if(!move_upload_to_archive($event)) return; send_event(new ThumbnailGenerationEvent($event->hash, $event->type)); diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index f6a4500a..8e21de8b 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -122,7 +122,7 @@ class Image { if(SPEED_HAX) { if(!$user->can("big_search") and count($tags) > 3) { - die("Anonymous users may only search for up to 3 tags at a time"); // FIXME: throw an exception? + throw new SCoreException("Anonymous users may only search for up to 3 tags at a time"); } } @@ -644,7 +644,7 @@ class Image { * images table. Yes, MySQL does suck this much. */ private static function build_accurate_search_querylet($terms) { - global $config, $database; + global $database; $tag_querylets = array(); $img_querylets = array(); @@ -804,7 +804,7 @@ class Image { * build_accurate_search_querylet() for a full explanation */ private static function build_ugly_search_querylet($terms) { - global $config, $database; + global $database; $tag_querylets = array(); $img_querylets = array(); diff --git a/core/user.class.php b/core/user.class.php index 50034926..110774c5 100644 --- a/core/user.class.php +++ b/core/user.class.php @@ -15,6 +15,9 @@ class User { var $name; var $email; var $join_date; + var $passhash; + + /* @var UserClass */ var $class; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/core/util.inc.php b/core/util.inc.php index 6de64efb..6bda7f04 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -385,7 +385,13 @@ function make_http(/*string*/ $link) { /** * Make a form tag with relevant auth token and stuff * - * @retval string + * @param target string + * @param method string + * @param multipart boolean + * @param form_id string + * @param onsubmit string + * + * @return string */ function make_form($target, $method="POST", $multipart=False, $form_id="", $onsubmit="") { global $user; @@ -1276,6 +1282,7 @@ function _sanitise_environment() { } function _get_themelet_files($_theme) { + $base_themelets = array(); if(file_exists('themes/'.$_theme.'/custompage.class.php')) $base_themelets[] = 'themes/'.$_theme.'/custompage.class.php'; $base_themelets[] = 'themes/'.$_theme.'/layout.class.php'; $base_themelets[] = 'themes/'.$_theme.'/themelet.class.php'; @@ -1406,7 +1413,7 @@ function _decaret($str) { } function _get_user() { - global $config, $database; + global $config; $user = null; if(get_prefixed_cookie("user") && get_prefixed_cookie("session")) { $tmp_user = User::by_session(get_prefixed_cookie("user"), get_prefixed_cookie("session")); diff --git a/ext/admin/theme.php b/ext/admin/theme.php index 64c18d2f..3eefdb11 100644 --- a/ext/admin/theme.php +++ b/ext/admin/theme.php @@ -14,9 +14,9 @@ class AdminPageTheme extends Themelet { protected function button(/*string*/ $name, /*string*/ $action, /*boolean*/ $protected=false) { $c_protected = $protected ? " protected" : ""; - $html = make_form(make_link("admin/$action"), "POST", false, false, false, "admin$c_protected"); + $html = make_form(make_link("admin/$action"), "POST", false, null, null, "admin$c_protected"); if($protected) { - $html .= ""; + $html .= ""; $html .= ""; } else { diff --git a/ext/artists/main.php b/ext/artists/main.php index 38c614f9..7aea77ad 100644 --- a/ext/artists/main.php +++ b/ext/artists/main.php @@ -143,7 +143,7 @@ class Artists extends Extension { } public function handle_commands($event) { - global $config, $page, $user; + global $page, $user; if($event->page_matches("artist")) { diff --git a/ext/artists/theme.php b/ext/artists/theme.php index acfe05e7..3fddc369 100644 --- a/ext/artists/theme.php +++ b/ext/artists/theme.php @@ -14,19 +14,11 @@ class ArtistsTheme extends Themelet { "; } - public function display_artists(){ - global $page; - - $page->set_title("Artists"); - $page->set_heading("Artists"); - $page->add_block(new Block("Artists", $html, "main", 10)); - - //$this->display_paginator($page, "artist/list", null, $pageNumber, $totalPages); - } - public function sidebar_options(/*string*/ $mode, $artistID=NULL, $is_admin=FALSE){ - global $page; - + global $page, $user; + + $html = ""; + if($mode == "neutral"){ $html = "
"; } - $page->add_block(new Block("Manage Artists", $html, "left", 10)); + + if($html) $page->add_block(new Block("Manage Artists", $html, "left", 10)); } public function show_artist_editor($artist, $aliases, $members, $urls) { + global $user; + $artistName = $artist['name']; $artistNotes = $artist['notes']; $artistID = $artist['id']; @@ -140,7 +135,7 @@ class ArtistsTheme extends Themelet { public function new_artist_composer() { - global $page; + global $page, $user; $html = "