account activation and password recovery implemented
authorCalin Burloiu <calin.burloiu@gmail.com>
Mon, 26 Sep 2011 15:47:09 +0000 (18:47 +0300)
committerCalin Burloiu <calin.burloiu@gmail.com>
Mon, 26 Sep 2011 15:47:09 +0000 (18:47 +0300)
15 files changed:
application/config/form_validation.php
application/config/p2p-tube.php
application/controllers/message.php [new file with mode: 0644]
application/controllers/user.php
application/exceptions/Send_email_exception.php [new file with mode: 0644]
application/language/english/form_validation_lang.php
application/language/english/user_lang.php
application/libraries/Image.php [new file with mode: 0644]
application/models/users_model.php
application/views/message/error_view.php [new file with mode: 0644]
application/views/message/info_view.php [new file with mode: 0644]
application/views/user/login_view.php
application/views/user/recover_password_view.php [new file with mode: 0644]
application/views/user/register_view.php
css/default.css

index 55e0212..ff6bd0d 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 $config = array(
-       'signin'=> array(
+       'login'=> array(
                array(
                        'field'=>'username',
                        'label'=>'lang:user_username_or_email',
@@ -86,6 +86,20 @@ $config = array(
                        'label'=>'lang:user_email',
                        'rules'=>'trim|required|xss_clean|valid_email|callback__do_resend_activation'
                )
+       ),
+       'recover_password'=> array(
+               array(
+                       'field'=>'username',
+                       'label'=>'lang:user_username',
+                       'rules'=>'trim|required|min_length[5]|max_length[32]'
+                               . '|strtolower|callback__valid_username|callback__username_exists|callback__internal_account'
+                               . '|callback__do_recover_password'
+               ),
+               array(
+                       'field'=>'email',
+                       'label'=>'lang:user_email',
+                       'rules'=>'trim|required|xss_clean|valid_email'
+               )
        )
 );
 
index 85dc44a..e924e69 100644 (file)
@@ -134,4 +134,15 @@ $config['search_results_per_page'] = 20;
 $config['available_languages_list'] = array(
        'en'=>'english',
        'ro'=>'romanian'
-);
\ No newline at end of file
+);
+
+/*
+|--------------------------------------------------------------------------
+| No-Reply E-mail address
+|--------------------------------------------------------------------------
+|
+| The e-mail address from which the users receive e-mail notifications
+| like account activation e-mail or password recovery.
+|
+*/
+$config['noreply_email'] = 'no-reply@p2p-next.cs.pub.ro';
\ No newline at end of file
diff --git a/application/controllers/message.php b/application/controllers/message.php
new file mode 100644 (file)
index 0000000..5d8b9dc
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+/**
+ * Class Message displays messages (info, error).
+ * 
+ * Messages are captured from 'msg' flash session variable.
+ *
+ * @category   Controller
+ * @author             Călin-Andrei Burloiu
+ */
+class Message extends CI_Controller {
+       
+       private $msg;
+       
+       public function __construct()
+       {
+               parent::__construct();
+               
+               $this->msg = $this->session->flashdata('msg');
+       }
+       
+       public function _remap($method, $params = array())
+       {       
+               if (! $this->msg)
+                       header('Location: '. site_url());
+
+               $params = array(
+                       'title'=> $this->lang->line("message_title_{$method}")
+                               .' &ndash; '
+                               . $this->config->item('site_name'),
+                       //'metas' => array('description'=>'')
+               );
+               $this->load->library('html_head_params', $params);
+               
+               // **
+               // ** LOADING VIEWS
+               // **
+               $this->load->view('html_begin', $this->html_head_params);
+               $this->load->view('header', array());
+               
+               $main_params['content'] =
+                       $this->load->view("message/{$method}_view",
+                               array('msg'=> $this->msg), TRUE);
+               
+               $main_params['side'] = $this->load->view('side_default', NULL, TRUE);
+               $this->load->view('main', $main_params);
+               
+               $this->load->view('footer');
+               $this->load->view('html_end');
+       }
+}
+
+/* End of file message.php */
+/* Location: ./application/controllers/message.php */
index 8c43cce..96454be 100644 (file)
@@ -23,6 +23,11 @@ class User extends CI_Controller {
        public function index()
        {
        }
+       
+       public function test($user_id = 1)
+       {
+               echo sha1('hQwCUEPQZcN8c4Es');
+       }
 
        /**
        * Login a user and then redirect it to the last page which must be encoded
@@ -38,7 +43,7 @@ class User extends CI_Controller {
                $this->form_validation->set_error_delimiters('<span class="error">',
                        '</span>');
 
-               if ($this->form_validation->run('signin') === FALSE)
+               if ($this->form_validation->run('login') === FALSE)
                {
                        $params = array(        'title' =>
                                                                        $this->lang->line('ui_nav_menu_login')
@@ -273,29 +278,60 @@ class User extends CI_Controller {
        
        public function activate($user_id, $method='', $activation_code='')
        {
-               $user_id = intval($user_id);
+               $user_id = intval($user_id);            
+               $res_form_validation = FALSE;
+               
+               if ($method == 'code')
+               {
+                       if (! $activation_code)
+                               $res_form_validation = $this->form_validation->run('activate');
+                       // Activation code is provided in URL.
+                       else
+                       {
+                               if ($this->_valid_activation_code($activation_code)
+                                               && $this->users_model->activate_account($user_id,
+                                                       $activation_code))
+                               {
+                                       $this->session->set_flashdata('msg', sprintf(
+                                               $this->lang->line('user_msg_activated_account'), 
+                                               site_url('user/login')));
+                                       header('Location: '. site_url('message/info'));
+                                       return;
+                               }
+                               else
+                               {
+                                       $this->session->set_flashdata('msg',
+                                               $this->lang->line('user_msg_wrong_activation_code'));
+                                       header('Location: '. site_url('message/error'));
+                                       return;
+                               }
+                       }
+               }
+               else if ($method == 'resend')
+               {
+                       $res_form_validation =
+                               $this->form_validation->run('resend_activation');
+               }
+               
                $userdata = $this->users_model->get_userdata($user_id,
                                'email, a.activation_code');
                $email = $userdata['email'];
-               //print_r($userdata['activation_code']);
                $activated_account = ($userdata['activation_code'] == NULL);
                
+               if ($activated_account)
+               {
+                       $this->session->set_flashdata('msg', sprintf(
+                                               $this->lang->line('user_msg_activated_account'), 
+                                               site_url('user/login')));
+                       header('Location: '. site_url('message/info'));
+                       return;
+               }
+               
                $this->load->library('form_validation');
                        
                $this->form_validation->set_error_delimiters('<span class="error">',
                                        '</span>');
                
-               $res_form_validation = FALSE;
-               if ($method == 'code')
-               {
-                       $res_form_validation = $this->form_validation->run('activate');
-               }
-               else if ($method == 'resend')
-               {
-                       $res_form_validation = 
-                                       $this->form_validation->run('resend_activation');
-               }
-               
                if ($res_form_validation === FALSE)
                {
                        $params = array(
@@ -312,19 +348,12 @@ class User extends CI_Controller {
                        $this->load->view('html_begin', $this->html_head_params);
                        $this->load->view('header', array());
 
-                       if (! $activated_account)
-                       {
-                               $main_params['content'] = 
-                                       $this->load->view('user/activate_view',
-                                       array('user_id'=> $user_id, 'email'=> $userdata['email']),
-                                       TRUE);
-                       }
-                       else
-                       {
-                               $main_params['content'] =
-                                       $this->load->view('user/activated_account_view',
-                                       NULL, TRUE);
-                       }
+                       // Show form
+                       $main_params['content'] = 
+                               $this->load->view('user/activate_view',
+                               array(  'user_id'=> $user_id,
+                                               'email'=> $userdata['email']),
+                               TRUE);
                        
                        $main_params['side'] = $this->load->view('side_default', NULL, TRUE);
                        $this->load->view('main', $main_params);
@@ -338,16 +367,71 @@ class User extends CI_Controller {
                        {
                                // Redirect to a message which tells the user that the
                                // activation was successful.
-                               header('Location: '. site_url("user/activate/$user_id"));
+                               $this->session->set_flashdata('msg', sprintf(
+                                               $this->lang->line('user_msg_activated_account'), 
+                                               site_url('user/login')));
+                               header('Location: '. site_url('message/info'));
+                               return;
                        }
                        else if ($method == 'resend')
                        {
-                               // Redirect to home page
-                               header('Location: '. site_url());
+                               // Redirect to resent message
+                               $this->session->set_flashdata('msg', sprintf(
+                                               $this->lang->line('user_msg_activation_resent'),
+                                               $this->input->post('email')));
+                               header('Location: '. site_url('message/info'));
+                               return;
                        }
                }
        }
        
+       public function recover_password()
+       {
+               $this->load->library('form_validation');
+                       
+               $this->form_validation->set_error_delimiters('<span class="error">',
+                       '</span>');
+
+               if ($this->form_validation->run('recover_password') === FALSE)
+               {
+                       $params = array(        'title' =>
+                                                                       $this->lang->line(
+                                                                               'user_title_password_recovery')
+                                                                               .' &ndash; '
+                                                                               . $this->config->item('site_name'),
+                                                               //'metas' => array('description'=>'')
+                       );
+                       $this->load->library('html_head_params', $params);
+                               
+                       // **
+                       // ** LOADING VIEWS
+                       // **
+                       $this->load->view('html_begin', $this->html_head_params);
+                       $this->load->view('header', array('selected_menu' => 
+                                       'recover_password'));
+
+                       $main_params['content'] = $this->load->view(
+                               'user/recover_password_view', array(),
+                               TRUE);
+                       
+                       $main_params['side'] = $this->load->view('side_default', NULL, TRUE);
+                       $this->load->view('main', $main_params);
+                               
+                       $this->load->view('footer');
+                       $this->load->view('html_end');
+               }
+               else
+               {
+                       // Redirect to resent message
+                       $this->session->set_flashdata('msg', sprintf(
+                                       $this->lang->line('user_msg_password_recovery_email_sent'),
+                                       $this->input->post('username'),
+                                       $this->input->post('email')));
+                       header('Location: '. site_url('message/info'));
+                       return;
+               }
+       }
+       
        public function _update_session_userdata($data)
        {
                foreach ($data as $key=> $val)
@@ -457,7 +541,46 @@ class User extends CI_Controller {
        
        public function _do_resend_activation($email)
        {
-               return FALSE;
+               $user_id = $this->input->post('user-id');
+               if ($user_id === FALSE)
+                       return FALSE;
+               $user_id = intval($user_id);
+               
+               $this->users_model->set_userdata($user_id,
+                       array('email'=> $email));
+               
+               return $this->users_model->send_activation_email($user_id, $email);
+       }
+       
+       public function _username_exists($username)
+       {
+               $userdata = $this->users_model->get_userdata($username);
+               
+               if (! $userdata)
+                       return FALSE;
+               
+               return TRUE;
+       }
+       
+       public function _internal_account($username)
+       {
+               $userdata = $this->users_model->get_userdata($username, 'auth_src');
+               if (! $userdata)
+                       return FALSE;
+
+               if ($userdata['auth_src'] != 'internal')
+                       return FALSE;
+               
+               return TRUE;
+       }
+       
+       public function _do_recover_password($username)
+       {
+               $email = $this->input->post('email');
+               if (! $email)
+                       return FALSE;
+               
+               return $this->users_model->recover_password($username, $email);
        }
 }
 
diff --git a/application/exceptions/Send_email_exception.php b/application/exceptions/Send_email_exception.php
new file mode 100644 (file)
index 0000000..17b3009
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+
+class Send_email_exception extends Exception
+{
+       
+}
\ No newline at end of file
index ce86d15..8ca5b5b 100644 (file)
@@ -17,6 +17,12 @@ $lang['_valid_activation_code']              = 'Invalid activation code. You must provide 16
 $lang['_do_activate']                          = 'Wrong activation code.';
 $lang['_do_resend_activation']         = 'An error occurred while resending your activation e-mail. This is not a permanent error. Please try again later.';
 
+// Password Recovery
+$lang['_username_exists']                      = 'There is no account registered with this username.';
+$lang['_internal_account']                     = 'You cannot change the password for this account because authentication is provided by a third-party.';
+$lang['_do_recover_password']          = 'Username and e-mail address are not associated with the same account.';
+
+
 
 /* End of file form_validation_lang.php */
 /* Location: ./system/language/english/form_validation_lang.php */
\ No newline at end of file
index 03ca5f2..cfb4939 100644 (file)
@@ -17,6 +17,7 @@ $lang['user_birth_date'] = 'Birth Date';
 $lang['user_date_format_hint'] = 'use format YEAR-MONTH-DAY';
 $lang['user_country'] = 'Country';
 $lang['user_locality'] = 'City / Town';
+$lang['user_picture'] = 'Profile Picture';
 $lang['user_ui_lang'] = 'Site Interface Language';
 $lang['user_time_zone'] = 'Time Zone';
 $lang['user_roles'] = 'Roles';
@@ -31,14 +32,45 @@ $lang['user_submit_save'] = 'Save';
 
 // Account Activation
 $lang['user_title_activation'] = 'Account Activation';
+$lang['user_title_password_recovery'] = 'Password Recovery';
 $lang['user_legend_activation'] = 'Activate your account';
 $lang['user_instruction_activation'] = 'Shortly after the registration you made you will receive an <em>activation e-mail</em> on your e-mail address you provided. In order to confirm that you are the owner of that e-mail address, follow the link there or enter the <em>activation code</em> also provided in that e-mail in the field below.';
 $lang['user_activation_code'] = 'Activation Code';
 $lang['user_submit_activate'] = 'Activate Account';
+$lang['user_submit_password_recovery'] = 'Recover Password';
 $lang['user_legend_resend_activation'] = 'Resend the activation code';
 $lang['user_instruction_resend_activation'] = 'The <em>activation e-mail</em> can take up to a few minutes until it arrives in your inbox, so please be patient. If you entered a wrong e-mail address, you can change it by entering another one in the field below. Pressing <em>Resend</em> will cause us to retransmit you the <em>activation e-mail</em> on the address entered in this field.';
+$lang['user_instruction_password_recovery'] = 'Enter you username and the e-mail address associated with your account and we will send you a new auto-generated password.';
 $lang['user_submit_resend_activation'] = 'Resend Activation E-mail';
 $lang['user_msg_activated_account'] = 'Your account is active so you can <a href="%s">login</a>. You successfully validated your e-mail address through the <em>activation e-mail</em>.';
+$lang['user_msg_wrong_activation_code'] = 'Wrong account activation code!';
+$lang['user_msg_activation_resent'] = 'Activation e-mail has been resent to %s!';
+$lang['user_msg_password_recovery_email_sent'] = 'An e-mail with a new password for user %s has been sent to %s.';
+$lang['user_link_password_recovery'] = 'Did you forget your password?';
+$lang['user_activation_email_content'] =
+"Hello %s,
+
+Please confirm that you registered a new account on %s (%s) by following the link below:
+
+%s
+
+If the link does not work try to copy it and then paste it into your address bar.
+
+Alternatively you can use the following Activation Code: %s
+
+Thank for registering!
+";
+$lang['user_password_recovery_email_content'] =
+"Hello %s,
+
+You requested a password recovery on %s (%s). Here is your new auto-generated password:
+
+%s
+
+It is recommended to change this password after you log in.
+
+Best regards!
+";
 
 $lang['user_no_videos_uploaded'] = 'The user uploaded no videos.';
 
diff --git a/application/libraries/Image.php b/application/libraries/Image.php
new file mode 100644 (file)
index 0000000..c4cd5fe
--- /dev/null
@@ -0,0 +1,90 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
+
+/**
+ * An image processing library initially intended for creating thumbnails.
+ * 
+ * @category   Library
+ * @author             Simon Jarvis, Călin-Andrei Burloiu
+ * @copyright  2006 Simon Jarvis, 2011 Călin-Andrei Burloiu
+ */
+
+class Image {
+        
+       var $image;
+       var $image_type;
+
+       function load($filename) {
+               $image_info = getimagesize($filename);
+               $this->image_type = $image_info[2];
+               if( $this->image_type == IMAGETYPE_JPEG ) {
+                       $this->image = imagecreatefromjpeg($filename);
+               } elseif( $this->image_type == IMAGETYPE_GIF ) {
+                       $this->image = imagecreatefromgif($filename);
+               } elseif( $this->image_type == IMAGETYPE_PNG ) {
+                       $this->image = imagecreatefrompng($filename);
+               }
+       }
+       function save($filename, $image_type=IMAGETYPE_JPEG, $compression=60, $permissions=null) {
+               if( $image_type == IMAGETYPE_JPEG ) {
+                       imagejpeg($this->image,$filename,$compression);
+               } elseif( $image_type == IMAGETYPE_GIF ) {
+                       imagegif($this->image,$filename);
+               } elseif( $image_type == IMAGETYPE_PNG ) {
+                       imagepng($this->image,$filename);
+               }
+               if( $permissions != null) {
+                       chmod($filename,$permissions);
+               }
+       }
+       function output($image_type=IMAGETYPE_JPEG) {
+               if( $image_type == IMAGETYPE_JPEG ) {
+                       imagejpeg($this->image);
+               } elseif( $image_type == IMAGETYPE_GIF ) {
+                       imagegif($this->image);
+               } elseif( $image_type == IMAGETYPE_PNG ) {
+                       imagepng($this->image);
+               }
+       }
+       function saveThumbnail($filename, $width, $height)
+       {
+               $ratio = $this->getWidth() / $this->getHeight();
+               $thumbRatio = $width / $height;
+
+               if($ratio < $thumbRatio)
+               $this->resizeToHeight($height);
+               else
+               $this->resizeToWidth($width);
+
+               $this->save($filename);
+       }
+       function getWidth() {
+               return imagesx($this->image);
+       }
+       function getHeight() {
+               return imagesy($this->image);
+       }
+       function resizeToHeight($height) {
+               $ratio = $height / $this->getHeight();
+               $width = $this->getWidth() * $ratio;
+               $this->resize($width,$height);
+       }
+       function resizeToWidth($width) {
+               $ratio = $width / $this->getWidth();
+               $height = $this->getheight() * $ratio;
+               $this->resize($width,$height);
+       }
+       function scale($scale) {
+               $width = $this->getWidth() * $scale/100;
+               $height = $this->getheight() * $scale/100;
+               $this->resize($width,$height);
+       }
+       function resize($width,$height) {
+               $new_image = imagecreatetruecolor($width, $height);
+               imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());
+               $this->image = $new_image;
+       }
+}
+
+
+/* End of file Singleton_db.php */
+/* Location: ./application/libraries/Singleton_db.php */
index 6faa6fa..d59987c 100644 (file)
@@ -221,13 +221,15 @@ class Users_model extends CI_Model {
                if ($query === FALSE)
                        return FALSE;
                
-               // If the registered with internal authentication it needs to activate
+               // If registered with internal authentication it needs to activate
                // the account.
-               $activation_code = Users_model::gen_activation_code();
+               $activation_code = Users_model::gen_activation_code($data['username']);
                $user_id = $this->get_user_id($data['username']);
                $query = $this->db->query("INSERT INTO `users_unactivated`
                        (user_id, activation_code)
                        VALUES ($user_id, '$activation_code')");
+               $this->send_activation_email($user_id, $data['email'],
+                       $activation_code, $data['username']);
                
                // TODO exception on failure
                return $query;
@@ -272,6 +274,64 @@ class Users_model extends CI_Model {
                return TRUE;
        }
        
+       public function send_activation_email($user_id, $email = NULL,
+                       $activation_code = NULL, $username = NULL)
+       {
+               if (!$activation_code || !$email || !$username)
+               {
+                       if (!$email)
+                               $cols = 'email, ';
+                       else
+                               $cols = '';
+                       
+                       $userdata = $this->get_userdata($user_id,
+                                       $cols. "a.activation_code, username");
+                       $activation_code =& $userdata['activation_code'];
+                       
+                       if (!$email)
+                               $email =& $userdata['email'];
+                       $username =& $userdata['username'];
+               }
+               
+               if ($activation_code === NULL)
+                       return TRUE;
+               
+               $subject = '['. $this->config->item('site_name')
+                               . '] Account Activation';
+               $activation_url =
+                               site_url("user/activate/$user_id/code/$activation_code"); 
+               $msg = sprintf($this->lang->line('user_activation_email_content'),
+                       $username, $this->config->item('site_name'), site_url(),
+                       $activation_url, $activation_code);
+               $headers = "From: ". $this->config->item('noreply_email');
+               
+               return mail($email, $subject, $msg, $headers);
+       }
+       
+       public function recover_password($username, $email)
+       {
+               $userdata = $this->get_userdata($username, 'email, username, id');
+               
+               if (strcmp($userdata['email'], $email) !== 0)
+                       return FALSE;
+               
+               $recovered_password = Users_model::gen_password();
+               
+               $this->set_userdata(intval($userdata['id']), array('password'=> 
+                               $recovered_password));
+               
+               $subject = '['. $this->config->item('site_name')
+               . '] Password Recovery';
+               $msg = sprintf($this->lang->line('user_password_recovery_email_content'),
+                       $username, $this->config->item('site_name'), site_url(),
+                       $recovered_password);
+               $headers = "From: ". $this->config->item('noreply_email');
+               
+               mail($email, $subject, $msg, $headers);
+               
+               return TRUE;
+       }
+       
        /**
         * Returns data from `users` table. If $user is int it is used as an
         * id, if it is string it is used as an username.
@@ -307,6 +367,7 @@ class Users_model extends CI_Model {
         * @param int $user_id
         * @param array $data   key-value pairs with columns and new values to be
         * modified
+        * @return boolean      returns TRUE on success and FALSE otherwise
         */
        public function set_userdata($user_id, $data)
        {
@@ -349,6 +410,26 @@ class Users_model extends CI_Model {
                return $activation_code;
        }
        
+       public static function gen_password()
+       {
+               $ci =& get_instance();
+               $length = 16;
+               $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.?!_-';
+               $len_chars = strlen($chars);
+               $enc_key = $ci->config->item('encryption_key');
+               $len_enc_key = strlen($enc_key);
+               $password = '';
+               
+               for ($p = 0; $p < $length; $p++) 
+               {
+                       $i = (mt_rand(1, 100) * ord($enc_key[ mt_rand(0, $len_enc_key-1) ]))
+                               % $len_chars;
+                       $password .= $chars[$i];
+               }
+               
+               return $password;
+       } 
+       
        public static function roles_to_string($roles)
        {
                $ci =& get_instance();
diff --git a/application/views/message/error_view.php b/application/views/message/error_view.php
new file mode 100644 (file)
index 0000000..d7dace7
--- /dev/null
@@ -0,0 +1,6 @@
+<div class="ui-widget">
+       <div style="padding: 0 .7em;" class="ui-state-error ui-corner-all"> 
+               <p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-alert"></span> 
+               <?php echo $msg ?></p>
+       </div>
+</div>
\ No newline at end of file
diff --git a/application/views/message/info_view.php b/application/views/message/info_view.php
new file mode 100644 (file)
index 0000000..82282fb
--- /dev/null
@@ -0,0 +1,6 @@
+<div class="ui-widget">
+       <div style="padding: 0 .7em;" class="ui-state-highlight ui-corner-all"> 
+               <p><span style="float: left; margin-right: .3em;" class="ui-icon ui-icon-info"></span> 
+               <?php echo $msg ?></p>
+       </div>
+</div>
\ No newline at end of file
index 2a3f945..b066866 100644 (file)
                        <input type="submit" value="<?php echo $this->lang->line('ui_nav_menu_log_in') ?>" />
                </td>
        </tr>
+       <tr>
+               <td></td>
+               <td>
+                       <p><a href="<?php echo site_url('user/recover_password') ?>"><?php echo $this->lang->line('user_link_password_recovery') ?></a></p>
+               </td>
+       </tr>
 </table>
 </form>
\ No newline at end of file
diff --git a/application/views/user/recover_password_view.php b/application/views/user/recover_password_view.php
new file mode 100644 (file)
index 0000000..954587c
--- /dev/null
@@ -0,0 +1,36 @@
+<?php echo form_open("user/recover_password") ?>
+<table class="form">
+       <tr>
+               <td></td>
+               <td>
+                       <p><?php echo $this->lang->line('user_instruction_password_recovery'); ?></p>
+               </td>
+       </tr>
+       <tr>
+               <th><?php echo $this->lang->line('user_username'). ': ' ?></th>
+               <td>
+                       <input type="text" name="username" size="24" value="<?php echo set_value('username') ?>" />
+               </td>
+       </tr>
+       <tr>
+               <td></td>
+               <td><?php echo form_error('username') ?></td>
+       </tr>
+       <tr>
+               <th><?php echo $this->lang->line('user_email'). ': ' ?></th>
+               <td>
+                       <input type="text" name="email" size="24" value="<? echo set_value('email') ?>" />
+               </td>
+       </tr>
+       <tr>
+               <td></td>
+               <td><?php echo form_error('email') ?></td>
+       </tr>
+       <tr>
+               <td></td>
+               <td>
+                       <input type="submit" value="<?php echo $this->lang->line('user_submit_password_recovery') ?>" />
+               </td>
+       </tr>
+</table>
+</form>
\ No newline at end of file
index 42159c2..438c410 100644 (file)
@@ -41,7 +41,7 @@ endif;
                        <input type="text" name="username" size="16" value="<?php echo _set_value($userdata, 'username') ?>" />
                </td>
          <?php else: ?>
-               <th><?php echo $this->lang->line('user_username'). ': ' ?></th>
+               <th><?php echo $this->lang->line('user_username'). ' : ' ?></th>
                <td>
                        &nbsp;<em><?php echo $userdata['username'] ?></em>
                </td>`
@@ -143,6 +143,14 @@ endif;
        </tr>
        <tr><td></td><td><?php echo form_error('locality') ?></td></tr>
        
+       <tr>
+               <th><?php echo $this->lang->line('user_picture'). ' : ' ?></th>
+               <td>
+                       <input type="file" name="picture" size="16" />
+               </td>
+       </tr>
+       <tr><td></td><td><?php echo form_error('locality') ?></td></tr>
+       
        <tr><td></td><td>&nbsp;</td></tr>
        
        <tr>
index 4448c97..223ef1c 100644 (file)
@@ -20,6 +20,11 @@ a:hover, a:active
        text-decoration: underline;
 }
 
+.ui-state-highlight a 
+{
+    color: rgb(0,90,192) !important;
+}
+
 h1
 {
        margin-top: 8px;