Changeset 496
- Timestamp:
- 05/16/08 23:04:18 (8 months ago)
- Location:
- trunk/app
- Files:
-
- 5 modified
-
config/sql/postgresql/karamelo.sql (modified) (3 diffs)
-
config/sql/postgresql/users.sql (modified) (2 diffs)
-
controllers/colleges_controller.php (modified) (3 diffs)
-
models/user.php (modified) (1 diff)
-
views/news/display.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/sql/postgresql/karamelo.sql
r436 r496 58 58 59 59 \i ./webquests.sql 60 \i ./result_webquests.sql 60 61 \i ./vclassrooms_webquests.sql 61 62 \i ./treasures.sql 62 63 \i ./treasures_vclassrooms.sql 64 \i ./result_treasures.sql 63 65 64 66 \i ./tests.sql … … 66 68 \i ./questions.sql 67 69 \i ./answers.sql 68 \i ./results.sql 70 \i ./results.sql --test results 71 \i ./participations.sql 69 72 70 73 \i ./shares.sql … … 73 76 74 77 -- Next I am not sure 75 \i ./communities.sql 76 \i ./communities_users.sql 78 \i ./communities.sql -- this tables will be used on 0.3 79 \i ./communities_users.sql 77 80 \i ./wikis.sql 78 81 \i ./wiki_revisions.sql 79 \i ./settings.sql 82 \i ./settings.sql 80 83 \i ./upload_revisions.sql 81 84 \i ./uploads.sql 82 83 84 85 86 87 88 89 -
trunk/app/config/sql/postgresql/users.sql
r446 r496 24 24 -- passwd = "karamelo" 25 25 INSERT INTO users("username", "pwd", "name", "email", "group_id", "active", "cv", "quote", "name_blog") 26 VALUES ('admin', ' f713c27c6cfc028ce4f756ea692dcf80af42846c', 'John Smith', 'john@site.edu',26 VALUES ('admin', '3916784b451c011b7ec822fb9bb66cfc3b5dbf0e', 'John Smith', 'john@site.edu', 27 27 1, 28 28 1, … … 30 30 '"Nonviolence is a weapon of the strong", Gandhi', 31 31 'The Lost Forest'); 32 -
trunk/app/controllers/colleges_controller.php
r415 r496 26 26 public function isAuthorized() 27 27 { 28 if (isset( $this->params[Configure::read('Routing.admin')] )) 29 { 30 if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ) // admin and teachers 31 { 32 return true; 33 } 34 } 35 return false; // go away !! 28 if (isset( $this->params[Configure::read('Routing.admin')] )): 29 if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ): // admin and teachers 30 return true; 31 endif; 32 endif; 33 return false; // go away !! 36 34 } 37 35 … … 50 48 } 51 49 52 /*** ======ADMIN METHODS === *****/50 /*** ======ADMIN METHODS === *****/ 53 51 public function admin_listing() 54 52 { 55 53 $this->layout = 'admin'; 56 54 57 $conditions = array( "id"=>1);58 $fields = array( "id", "name", "email", "urlbase", "description", "keywords");59 $order = "College.id DESC";55 $conditions = array('id'=>1); 56 $fields = array('id', 'name', 'email', 'urlbase', 'description', 'keywords'); 57 $order = 'College.id DESC'; 60 58 $data = $this->College->find($conditions, $fields); 61 $this->pageTitle = $data['College'][' title'];59 $this->pageTitle = $data['College']['name']; 62 60 63 61 $this->set('data', $data); … … 68 66 $this->layout = 'admin'; 69 67 70 if ( empty( $this->data["College"] ) ) 71 { 68 if ( empty( $this->data['College'] ) ): 72 69 $this->College->id = $id; 73 70 74 71 $this->data = $this->College->read(); 75 72 76 } 77 else 78 { 73 else: 74 79 75 $this->Sanitize = new Sanitize; 80 76 81 $this->Sanitize->html($this->data[ "College"]["name"]);77 $this->Sanitize->html($this->data['College']['name']); 82 78 83 $this->Sanitize->html($this->data[ "College"]["description"]);79 $this->Sanitize->html($this->data['College']['description']); 84 80 85 if ($this->College->save($this->data["College"])) 86 { 87 if ( $this->data["College"]["end"] == 1 ) 88 { 81 if ($this->College->save($this->data['College'])): 82 if ( $this->data['College']["end"] == 1 ): 89 83 $this->redirect('/admin/colleges/listing'); 90 }91 else92 {93 $this->msgFlash('Data saved', '/admin/colleges/edit/'.$this->data[ "College"]["id"]);94 }95 } 96 }84 85 else: 86 87 $this->msgFlash('Data saved', '/admin/colleges/edit/'.$this->data['College']['id']); 88 endif; 89 endif; 90 endif; 97 91 } 98 92 } -
trunk/app/models/user.php
r480 r496 112 112 113 113 if ( !empty($this->data['User']['pwd']) ): 114 die( debug($this->data['User']['pwd']));114 115 115 if ( strlen($this->data['User']['pwd']) < 6): // only if pwd is big enough 116 116 unset($this->data['User']['pwd']); -
trunk/app/views/news/display.ctp
r409 r496 37 37 <span style="font-size:7pt;">Permalink:</span> <br /> 38 38 <?php echo $html->link( 39 'http://'.$_SERVER[' SERVER_NAME'].'/news/view/'.$val['News']['id'],40 'http://'.$_SERVER[' SERVER_NAME'].'/news/view/'.$val['News']['id']39 'http://'.$_SERVER['HTTP_HOST'].'/news/view/'.$val['News']['id'], 40 'http://'.$_SERVER['HTTP_HOST'].'/news/view/'.$val['News']['id'] 41 41 ); 42 42 ?>
