[Isocial-svn] SF.net SVN: isocial:[297] app/controllers
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <fsn...@us...> - 2008-08-26 11:36:41
|
Revision: 297 http://isocial.svn.sourceforge.net/isocial/?rev=297&view=rev Author: fsnobody Date: 2008-08-26 11:36:51 +0000 (Tue, 26 Aug 2008) Log Message: ----------- system album created - only on confirmation, + ui fix Modified Paths: -------------- app/controllers/blogapp/post_controller.php app/controllers/photoapp/album_controller.php app/controllers/user_controller.php Modified: app/controllers/blogapp/post_controller.php =================================================================== --- app/controllers/blogapp/post_controller.php 2008-08-26 11:14:57 UTC (rev 296) +++ app/controllers/blogapp/post_controller.php 2008-08-26 11:36:51 UTC (rev 297) @@ -2,7 +2,7 @@ class Blogapp_PostController extends ApplicationController { - var $models = array('blogapp', 'blogapp_post', 'blogapp_attachment'); + var $models = array('blogapp', 'blogapp_post', 'blogapp_attachment', ); function index () { $this->posts = $this->BlogappPost->find('all', array('conditions' => array('user_id = ' . $this->current_user->getId()))); Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-08-26 11:14:57 UTC (rev 296) +++ app/controllers/photoapp/album_controller.php 2008-08-26 11:36:51 UTC (rev 297) @@ -253,6 +253,9 @@ } else if (!empty($this->params['id']) && $this->PhotoappAlbum->find($this->params['id'])) { // pre delete $this->album = $this->PhotoappAlbum->find($this->params['id']); + if ($this->album->is_default == 1) { + $this->redirectTo(array('action' => 'index')); // system album - not permited for edit + } } } Modified: app/controllers/user_controller.php =================================================================== --- app/controllers/user_controller.php 2008-08-26 11:14:57 UTC (rev 296) +++ app/controllers/user_controller.php 2008-08-26 11:36:51 UTC (rev 297) @@ -42,10 +42,11 @@ $user = $this->User->login($email, $password); if ($user && $user->active) { $this->_login($user->id); +/* $system_album = $this->PhotoappAlbum->findFirst(array('owner' => $user->id, 'is_default' => 1)); if (!$system_album) $this->create_system_photoalbum($user); - +*/ if ($remember_me) { setcookie(session_name(), session_id(), time() + 60 * 60 * 24 * 365 * 3, '/'); } @@ -58,9 +59,9 @@ // create system PhotoAlbum $system_album = new $this->PhotoappAlbum; $album_opt = array( - 'name' => 'system', + 'name' => 'unsorted', 'owner' => $user->getId(), - 'description' => 'system storage', + 'description' => 'unsorted, uploaded by blog images', 'is_default' => 1 ); $system_album->setAttributes($album_opt); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |