From 4832e8eab0cb54692fa31d7d2eb0f7f2ca71bb32 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Fri, 9 Sep 2011 00:02:44 +0200 Subject: [PATCH] Add simple user profiles --- application/controllers/users.php | 50 +++++++++++++++++++++++++++++ application/views/header.php | 2 +- application/views/projects/list.php | 2 +- application/views/users/index.html | 10 ++++++ application/views/users/profile.php | 20 ++++++++++++ 5 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 application/controllers/users.php create mode 100755 application/views/users/index.html create mode 100644 application/views/users/profile.php diff --git a/application/controllers/users.php b/application/controllers/users.php new file mode 100644 index 0000000..22a60b9 --- /dev/null +++ b/application/controllers/users.php @@ -0,0 +1,50 @@ + + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * + * @author Eike Foken + */ +class Users extends CI_Controller { + + /** + * Calls the parent constructor. + */ + public function __construct() { + parent::__construct(); + $this->load->model('user'); + } + + /** + * Shows a users profile. + * + * @param string $username + */ + public function profile($username) { + $data['user'] = $this->user->profile($username); + $this->load->view('users/profile', $data); + } +} + +/* End of file users.php */ +/* Location: ./application/controllers/users.php */ diff --git a/application/views/header.php b/application/views/header.php index e140c61..10142ee 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -54,7 +54,7 @@ ?> - +
diff --git a/application/views/projects/list.php b/application/views/projects/list.php index 7c115e2..662c600 100644 --- a/application/views/projects/list.php +++ b/application/views/projects/list.php @@ -22,7 +22,7 @@ ?> "> - + | diff --git a/application/views/users/index.html b/application/views/users/index.html new file mode 100755 index 0000000..c942a79 --- /dev/null +++ b/application/views/users/index.html @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

Directory access is forbidden.

+ + + \ No newline at end of file diff --git a/application/views/users/profile.php b/application/views/users/profile.php new file mode 100644 index 0000000..3251458 --- /dev/null +++ b/application/views/users/profile.php @@ -0,0 +1,20 @@ +load->view('header');?> + +
+ +
+

firstname;?> lastname;?>

+
+ +
+

+

+ : firstname;?> lastname;?>
+ : institution;?>
+ : phone;?>
+

+
+ +
+ +load->view('footer');?>