summaryrefslogtreecommitdiff
path: root/core/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'core/controllers')
-rw-r--r--core/controllers/items.php3
-rw-r--r--core/controllers/welcome.php11
2 files changed, 3 insertions, 11 deletions
diff --git a/core/controllers/items.php b/core/controllers/items.php
index a5dd5f1e..efbfa8d9 100644
--- a/core/controllers/items.php
+++ b/core/controllers/items.php
@@ -51,8 +51,7 @@ class Items_Controller extends REST_Controller {
public function _create($item) {
// @todo Productionize this code
// 1) Add security checks
- $user = Session::instance()->get("user");
- $owner_id = $user ? $user->id : $item->owner_id;
+ $owner_id = user::active()->id;
switch ($this->input->post("type")) {
case "album":
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index bddca606..3f70e1dc 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -34,7 +34,6 @@ class Welcome_Controller extends Template_Controller {
$this->template->deepest_photo = ORM::factory("item")
->where("type", "photo")->orderby("level", "desc")->find();
$this->template->album_tree = $this->_load_album_tree();
- $this->template->rearrange_html = new View("rearrange.html");
$this->template->add_photo_html = $this->_get_add_photo_html();
if (module::is_installed("local_import")) {
$this->template->local_import_html = $this->_get_local_import_html();
@@ -46,7 +45,6 @@ class Welcome_Controller extends Template_Controller {
$this->template->photo_count = 0;
$this->template->deepest_photo = null;
$this->template->album_tree = array();
- $this->template->rearrange_html = "";
$this->template->add_photo_html = "";
$this->template->local_import_html = "";
}
@@ -205,13 +203,7 @@ class Welcome_Controller extends Template_Controller {
function add_albums_and_photos($count, $desired_type=null) {
srand(time());
$parents = ORM::factory("item")->where("type", "album")->find_all()->as_array();
-
- try {
- $user = Session::instance()->get("user");
- $owner_id = $user ? $user->id : ORM::factory("user")->find()->id;
- } catch (Exception $e) {
- $owner_id = null;
- }
+ $owner_id = user::active()->id;
for ($i = 0; $i < $count; $i++) {
set_time_limit(30);
@@ -486,6 +478,7 @@ class Welcome_Controller extends Template_Controller {
$tree[$album->id]->album = $album;
$tree[$album->id]->children = array();
}
+
return $tree;
}