Add simple user profiles
This commit is contained in:
50
application/controllers/users.php
Normal file
50
application/controllers/users.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php defined('BASEPATH') || exit('No direct script access allowed');
|
||||
/*
|
||||
* Copyright (c) 2011 Eike Foken <kontakt@eikefoken.de>
|
||||
*
|
||||
* 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 <kontakt@eikefoken.de>
|
||||
*/
|
||||
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 */
|
||||
@@ -54,7 +54,7 @@
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="menu"><?=_('Hello,');?> <a href="<?=site_url('users/' . $this->user->profile()->id);?>"><?=$this->user->profile()->firstname;?> <?=$this->user->profile()->lastname;?></a>! | <?=lang_select('assets/images');?> | <a href="#"><?=_('Help');?></a> | <?=anchor('auth/settings', _('Settings'));?> | <?=anchor('auth/logout', _('Logout'));?></div>
|
||||
<div class="menu"><?=_('Hello,');?> <a href="<?=site_url('users/profile/' . $this->user->profile()->username);?>"><?=$this->user->profile()->firstname;?> <?=$this->user->profile()->lastname;?></a>! | <?=lang_select('assets/images');?> | <a href="#"><?=_('Help');?></a> | <?=anchor('auth/settings', _('Settings'));?> | <?=anchor('auth/logout', _('Logout'));?></div>
|
||||
</div>
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="<?=site_url('projects/detail/' . $project['id'] . '?active_project=' . $project['id']);?>"><abbr title="<?=$project['name'] . "\n\n" . $project['description'];?>"><?=$project['mediumname'];?></abbr></a></td>
|
||||
<td><?=$project['firstname'] . " " . $project['lastname'];?></td>
|
||||
<td><a href="<?=site_url('users/profile/' . $project['username']);?>" title="<?=_('Show profile');?>"><?=$project['firstname'] . ' ' . $project['lastname'];?></a></td>
|
||||
<td><span class="active"><?=_('Successfully finished');?></span></td>
|
||||
<td><a href="#"><?=_('Show results');?></a> | <?=anchor('projects/delete/' . $project['id'], _('Delete'));?>
|
||||
</td>
|
||||
|
||||
10
application/views/users/index.html
Executable file
10
application/views/users/index.html
Executable file
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
application/views/users/profile.php
Normal file
20
application/views/users/profile.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php $this->load->view('header');?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div class="title">
|
||||
<h2><?=$user->firstname;?> <?=$user->lastname;?></h2>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<h3><?=_('Personal information');?></h3>
|
||||
<p>
|
||||
<strong><?=_('Name');?>:</strong> <?=$user->firstname;?> <?=$user->lastname;?><br />
|
||||
<strong><?=_('Institution');?>:</strong> <?=$user->institution;?><br />
|
||||
<strong><?=_('Phone number');?>:</strong> <?=$user->phone;?><br />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('footer');?>
|
||||
Reference in New Issue
Block a user