From 93de016032e54b45db35f18d8538fd5b11a7c72e Mon Sep 17 00:00:00 2001 From: Calin Burloiu Date: Fri, 16 Sep 2011 17:23:34 +0300 Subject: [PATCH] login works; working at register --- application/config/form_validation.php | 64 +++++ application/config/ldap.php | 8 + application/config/localization.php | 234 ++++++++++++++++++ application/config/p2p-tube.php | 14 ++ application/controllers/article.php | 2 +- application/controllers/catalog.php | 21 +- application/controllers/user.php | 169 ++++++++++--- application/controllers/video.php | 2 +- application/helpers/MY_url_helper.php | 36 +++ application/helpers/localization_helper.php | 75 ++++++ application/language/english/article_lang.php | 3 + .../language/english/form_validation_lang.php | 3 +- application/language/english/ui_lang.php | 4 + application/language/english/user_lang.php | 6 +- application/models/users_model.php | 104 +++++++- application/views/header.php | 34 ++- application/views/user/login_view.php | 3 +- application/views/user/register_view.php | 125 ++++++++++ css/default.css | 25 ++ img/calendar.gif | Bin 0 -> 269 bytes scripts/sync.sh | 3 + 21 files changed, 866 insertions(+), 69 deletions(-) create mode 100644 application/config/form_validation.php create mode 100644 application/config/ldap.php create mode 100644 application/config/localization.php create mode 100644 application/helpers/MY_url_helper.php create mode 100644 application/helpers/localization_helper.php create mode 100644 application/views/user/register_view.php create mode 100644 img/calendar.gif create mode 100755 scripts/sync.sh diff --git a/application/config/form_validation.php b/application/config/form_validation.php new file mode 100644 index 0000000..bd30bb4 --- /dev/null +++ b/application/config/form_validation.php @@ -0,0 +1,64 @@ + array( + array( + 'field'=>'username', + 'label'=>'lang:user_username_or_email', + 'rules'=>'trim|required|min_length[5]|max_length[32]' + . '|strtolower|callback__valid_username_or_email' + . '|callback__do_login[password]' + ), + array( + 'field'=>'password', + 'label'=>'lang:user_password', + 'rules'=>'required|min_length[5]|max_length[32]' + ) + ), + 'register'=> array( + array( + 'field'=>'username', + 'label'=>'lang:user_username', + 'rules'=>'trim|required|min_length[5]|max_length[32]' + . '|strtolower|callback__valid_username' + ), + array( + 'field'=>'password', + 'label'=>'lang:user_password', + 'rules'=>'required' + ), + array( + 'field'=>'password-confirmation', + 'label'=>'lang:user_password_confirmation', + 'rules'=>'required' + ), + array( + 'field'=>'email', + 'label'=>'lang:user_email', + 'rules'=>'required' + ), + array( + 'field'=>'first-name', + 'label'=>'lang:user_first_name', + 'rules'=>'required' + ), + array( + 'field'=>'last-name', + 'label'=>'lang:user_last_name', + 'rules'=>'required' + ), + array( + 'field'=>'birth-date', + 'label'=>'lang:user_birth_date', + 'rules'=>'' + ), + array( + 'field'=>'locality', + 'label'=>'lang:user_locality', + 'rules'=>'' + ) + ) +); + +/* End of file form_validation.php */ +/* Location: ./application/config/form_validation.php */ \ No newline at end of file diff --git a/application/config/ldap.php b/application/config/ldap.php new file mode 100644 index 0000000..420659c --- /dev/null +++ b/application/config/ldap.php @@ -0,0 +1,8 @@ +"Afghanistan", + "AL"=>"Albania", + "DZ"=>"Algeria", + "AD"=>"Andorra", + "AO"=>"Angola", + "AI"=>"Anguilla", + "AQ"=>"Antarctica", + "AG"=>"Antigua and Barbuda", + "AR"=>"Argentina", + "AM"=>"Armenia", + "AW"=>"Aruba", + "AU"=>"Australia", + "AT"=>"Austria", + "AZ"=>"Azerbaijan", + "BS"=>"Bahamas", + "BH"=>"Bahrain", + "BD"=>"Bangladesh", + "BB"=>"Barbados", + "BY"=>"Belarus", + "BE"=>"Belgium", + "BZ"=>"Belize", + "BJ"=>"Benin", + "BM"=>"Bermuda", + "BT"=>"Bhutan", + "BO"=>"Bolivia", + "BA"=>"Bosnia and Herzegovina", + "BW"=>"Botswana", + "BR"=>"Brazil", + "IO"=>"British Indian Ocean", + "BN"=>"Brunei", + "BG"=>"Bulgaria", + "BF"=>"Burkina Faso", + "BI"=>"Burundi", + "KH"=>"Cambodia", + "CM"=>"Cameroon", + "CA"=>"Canada", + "CV"=>"Cape Verde", + "KY"=>"Cayman Islands", + "CF"=>"Central African Republic", + "TD"=>"Chad", + "CL"=>"Chile", + "CN"=>"China", + "CX"=>"Christmas Island", + "CC"=>"Cocos (Keeling) Islands", + "CO"=>"Colombia", + "KM"=>"Comoros", + "CD"=>"Congo, Democratic Republic of the", + "CG"=>"Congo, Republic of the", + "CK"=>"Cook Islands", + "CR"=>"Costa Rica", + "HR"=>"Croatia", + "CY"=>"Cyprus", + "CZ"=>"Czech Republic", + "DK"=>"Denmark", + "DJ"=>"Djibouti", + "DM"=>"Dominica", + "DO"=>"Dominican Republic", + "TL"=>"East Timor", + "EC"=>"Ecuador", + "EG"=>"Egypt", + "SV"=>"El Salvador", + "GQ"=>"Equatorial Guinea", + "ER"=>"Eritrea", + "EE"=>"Estonia", + "ET"=>"Ethiopia", + "FK"=>"Falkland Islands (Malvinas)", + "FO"=>"Faroe Islands", + "FJ"=>"Fiji", + "FI"=>"Finland", + "FR"=>"France", + "GF"=>"French Guiana", + "PF"=>"French Polynesia", + "GA"=>"Gabon", + "GM"=>"Gambia", + "GE"=>"Georgia", + "DE"=>"Germany", + "GH"=>"Ghana", + "GI"=>"Gibraltar", + "GR"=>"Greece", + "GL"=>"Greenland", + "GD"=>"Grenada", + "GP"=>"Guadeloupe", + "GT"=>"Guatemala", + "GN"=>"Guinea", + "GW"=>"Guinea-Bissau", + "GY"=>"Guyana", + "HT"=>"Haiti", + "HN"=>"Honduras", + "HK"=>"Hong Kong", + "HU"=>"Hungary", + "IS"=>"Iceland", + "IN"=>"India", + "ID"=>"Indonesia", + "IE"=>"Ireland", + "IL"=>"Israel", + "IT"=>"Italy", + "CI"=>"Ivory Coast (Côte d\'Ivoire)", + "JM"=>"Jamaica", + "JP"=>"Japan", + "JO"=>"Jordan", + "KZ"=>"Kazakhstan", + "KE"=>"Kenya", + "KI"=>"Kiribati", + "KR"=>"Korea, South", + "KW"=>"Kuwait", + "KG"=>"Kyrgyzstan", + "LA"=>"Laos", + "LV"=>"Latvia", + "LB"=>"Lebanon", + "LS"=>"Lesotho", + "LI"=>"Liechtenstein", + "LT"=>"Lithuania", + "LU"=>"Luxembourg", + "MO"=>"Macau", + "MK"=>"Macedonia, Republic of", + "MG"=>"Madagascar", + "MW"=>"Malawi", + "MY"=>"Malaysia", + "MV"=>"Maldives", + "ML"=>"Mali", + "MT"=>"Malta", + "MH"=>"Marshall Islands", + "MQ"=>"Martinique", + "MR"=>"Mauritania", + "MU"=>"Mauritius", + "YT"=>"Mayotte", + "MX"=>"Mexico", + "FM"=>"Micronesia", + "MD"=>"Moldova", + "MC"=>"Monaco", + "MN"=>"Mongolia", + "ME"=>"Montenegro", + "MS"=>"Montserrat", + "MA"=>"Morocco", + "MZ"=>"Mozambique", + "NA"=>"Namibia", + "NR"=>"Nauru", + "NP"=>"Nepal", + "NL"=>"Netherlands", + "AN"=>"Netherlands Antilles", + "NC"=>"New Caledonia", + "NZ"=>"New Zealand", + "NI"=>"Nicaragua", + "NE"=>"Niger", + "NG"=>"Nigeria", + "NU"=>"Niue", + "NF"=>"Norfolk Island", + "NO"=>"Norway", + "OM"=>"Oman", + "PK"=>"Pakistan", + "PS"=>"Palestinian Territory", + "PA"=>"Panama", + "PG"=>"Papua New Guinea", + "PY"=>"Paraguay", + "PE"=>"Peru", + "PH"=>"Philippines", + "PN"=>"Pitcairn Island", + "PL"=>"Poland", + "PT"=>"Portugal", + "QA"=>"Qatar", + "RE"=>"Réunion", + "RO"=>"Romania", + "RU"=>"Russia", + "RW"=>"Rwanda", + "SH"=>"Saint Helena", + "KN"=>"Saint Kitts and Nevis", + "LC"=>"Saint Lucia", + "PM"=>"Saint Pierre and Miquelon", + "VC"=>"Saint Vincent and the Grenadines", + "WS"=>"Samoa", + "SM"=>"San Marino", + "ST"=>"São Tome and Principe", + "SA"=>"Saudi Arabia", + "SN"=>"Senegal", + "RS"=>"Serbia", + "CS"=>"Serbia and Montenegro", + "SC"=>"Seychelles", + "SL"=>"Sierra Leon", + "SG"=>"Singapore", + "SK"=>"Slovakia", + "SI"=>"Slovenia", + "SB"=>"Solomon Islands", + "SO"=>"Somalia", + "ZA"=>"South Africa", + "GS"=>"South Georgia and the South Sandwich Islands", + "ES"=>"Spain", + "LK"=>"Sri Lanka", + "SR"=>"Suriname", + "SJ"=>"Svalbard and Jan Mayen", + "SZ"=>"Swaziland", + "SE"=>"Sweden", + "CH"=>"Switzerland", + "TW"=>"Taiwan", + "TJ"=>"Tajikistan", + "TZ"=>"Tanzania", + "TH"=>"Thailand", + "TG"=>"Togo", + "TK"=>"Tokelau", + "TO"=>"Tonga", + "TT"=>"Trinidad and Tobago", + "TN"=>"Tunisia", + "TR"=>"Turkey", + "TM"=>"Turkmenistan", + "TC"=>"Turks and Caicos Islands", + "TV"=>"Tuvalu", + "UG"=>"Uganda", + "UA"=>"Ukraine", + "AE"=>"United Arab Emirates", + "GB"=>"United Kingdom", + "US"=>"United States", + "UM"=>"United States Minor Outlying Islands", + "UY"=>"Uruguay", + "UZ"=>"Uzbekistan", + "VU"=>"Vanuatu", + "VA"=>"Vatican City", + "VE"=>"Venezuela", + "VN"=>"Vietnam", + "VG"=>"Virgin Islands, British", + "WF"=>"Wallis and Futuna", + "EH"=>"Western Sahara", + "YE"=>"Yemen", + "ZM"=>"Zambia", + "ZW"=>"Zimbabwe" +); \ No newline at end of file diff --git a/application/config/p2p-tube.php b/application/config/p2p-tube.php index a71d1b7..85dc44a 100644 --- a/application/config/p2p-tube.php +++ b/application/config/p2p-tube.php @@ -121,3 +121,17 @@ $config['videos_per_row'] = 5; | */ $config['search_results_per_page'] = 20; + +/* +|-------------------------------------------------------------------------- +| A list with all available languages in which the site is translated +|-------------------------------------------------------------------------- +| +| Keys are language codes and values are language names as they appear in +| languages folder. +| +*/ +$config['available_languages_list'] = array( + 'en'=>'english', + 'ro'=>'romanian' +); \ No newline at end of file diff --git a/application/controllers/article.php b/application/controllers/article.php index f1909b9..1272425 100644 --- a/application/controllers/article.php +++ b/application/controllers/article.php @@ -24,7 +24,7 @@ class Article extends Article_Controller { // ** DATA // ** - $html_params = array('title' => $this->title.' - ' + $html_params = array('title' => $this->title.' – ' . $this->config->item('site_name'), 'css' => $this->css, 'js' => $this->js, diff --git a/application/controllers/catalog.php b/application/controllers/catalog.php index 743342e..4570c1e 100644 --- a/application/controllers/catalog.php +++ b/application/controllers/catalog.php @@ -56,8 +56,7 @@ class Catalog extends CI_Controller { // ** $this->load->view('html_begin', $this->html_head_params); $this->load->view('header', array( - 'selected_menu'=> 'home', - 'username'=> $this->session->userdata('username') + 'selected_menu'=> 'home' )); $main_params['content'] = $this->load->view('catalog/index_view', $data, TRUE); @@ -103,7 +102,9 @@ class Catalog extends CI_Controller { // $data['video_summary'] = $this->load->view('catalog/videos_summary_view', // $vs_data, TRUE); - $params = array( 'title' => $this->config->item('site_name'), + $params = array( 'title' => + $vs_data['category_title'].' – ' + . $this->config->item('site_name'), 'css' => array( 'catalog.css' ), @@ -117,7 +118,7 @@ class Catalog extends CI_Controller { // ** $this->load->view('html_begin', $this->html_head_params); $this->load->view('header', array( - 'search_category_name'=>$vs_data['category_name'], + 'search_category_name'=> $vs_data['category_name'] )); // $main_params['content'] = $this->load->view('catalog/category_view', $data, TRUE); @@ -203,7 +204,8 @@ class Catalog extends CI_Controller { } // HTML head parameters - $params = array( 'title' => $this->config->item('site_name'), + $params = array( 'title' => 'Search Results – ' + . $this->config->item('site_name'), 'css' => array( 'catalog.css' ), @@ -231,10 +233,11 @@ class Catalog extends CI_Controller { public function error($msg, $header_data) { - $params = array( 'title' => 'Error - '. $this->config->item('site_name'), - //'css' => array(), - //'js' => array(), - //'metas' => array('description'=>'','keywords'=>'') + $params = array( 'title' => 'Error – ' + . $this->config->item('site_name'), + //'css' => array(), + //'js' => array(), + //'metas' => array('description'=>'','keywords'=>'') ); $this->load->library('html_head_params', $params); diff --git a/application/controllers/user.php b/application/controllers/user.php index 33dd727..985bf43 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -11,6 +11,7 @@ class User extends CI_Controller { private $username = NULL; private $email = NULL; private $user_id = NULL; + private $ldap_user_info = NULL; public function __construct() { @@ -23,40 +24,28 @@ class User extends CI_Controller { { } - public function login() + /** + * Login a user and then redirect it to the last page which must be encoded + * in $redirect. + * + * @param string $redirect contains the last page URI segments encoded + * with helper url_encode_segments. + */ + public function login($redirect = '') { $this->load->library('form_validation'); $this->load->model('users_model'); - - $username = $this->input->post('username'); - $password = $this->input->post('password'); - $form_validation_config = array( - array( - 'field'=>'username', - 'label'=>'lang:user_username_or_email', - 'rules'=>'trim|required|min_length[5]|max_length[32]' - . '|strtolower|callback__valid_username' - . '|callback__do_login[password]' - ), - array( - 'field'=>'password', - 'label'=>'lang:user_password', - 'rules'=>'required|min_length[5]|max_length[32]' - ) - ); - $this->form_validation->set_rules($form_validation_config); $this->form_validation->set_error_delimiters('', ''); - if ($this->form_validation->run() === FALSE) + if ($this->form_validation->run('signin') === FALSE) { - $params = array( 'title' => $this->config->item('site_name'), - 'css' => array( - 'catalog.css' - ), - //'js' => array(), - //'metas' => array('description'=>'') + $params = array( 'title' => + $this->lang->line('ui_nav_menu_login') + .' – ' + . $this->config->item('site_name'), + //'metas' => array('description'=>'') ); $this->load->library('html_head_params', $params); @@ -66,7 +55,9 @@ class User extends CI_Controller { $this->load->view('html_begin', $this->html_head_params); $this->load->view('header', array('selected_menu' => 'login')); - $this->load->view('user/login_view', array()); + $this->load->view('user/login_view', array( + 'redirect'=> $redirect + )); $this->load->view('footer'); $this->load->view('html_end'); @@ -79,21 +70,111 @@ class User extends CI_Controller { 'user_id'=> $this->user_id, 'username'=> $this->username )); + + // Redirect to last page before login. + header('Location: '. site_url(urldecode_segments($redirect))); + } + else + { + $this->session->set_userdata(array( + 'username'=> $this->username + )); + + // Redirect to register page because an user authenticates here + // for the first time with LDAP. + // TODO + header('Location: '. site_url(urldecode_segments($redirect))); } + } + } + + /** + * Logout user and then redirect it to the last page which must be encoded + * in $redirect. + * + * @param string $redirect contains the last page URI segments encoded + * with helper url_encode_segments. + */ + public function logout($redirect = '') + { + $this->session->unset_userdata('user_id'); + $this->session->unset_userdata('username'); + + header('Location: '. site_url(urldecode_segments($redirect))); + } + + public function register($redirect = '') + { + $this->load->library('form_validation'); + $this->load->model('users_model'); + $this->load->helper('localization'); + $this->load->helper('date'); - header('Location: '. site_url()); - return; + $this->form_validation->set_error_delimiters('', + ''); + + if ($this->form_validation->run('register') === FALSE) + { + $params = array('title' => + $this->lang->line('ui_nav_menu_register') + .' – ' + . $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' => 'register')); + + $this->load->view('user/register_view', array( + 'redirect'=> $redirect + )); + + $this->load->view('footer'); + $this->load->view('html_end'); + } + else + { + if ($this->user_id !== NULL) + { + $this->session->set_userdata(array( + 'user_id'=> $this->user_id, + 'username'=> $this->username + )); + + // Redirect to last page before login. + header('Location: '. site_url(urldecode_segments($redirect))); + } + else + { + $this->session->set_userdata(array( + 'username'=> $this->username + )); + + // Redirect to register page because an user authenticates here + // for the first time with LDAP. + // TODO + header('Location: '. site_url(urldecode_segments($redirect))); + } } } - + public function _valid_username($username) + { + return (preg_match('/^[a-z0-9\._]+$/', $username) == 1); + } + + public function _valid_username_or_email($username) { $this->load->helper('email'); if (valid_email($username)) - return TRUE; + return TRUE; else - return (preg_match('/^[a-z0-9\._]+$/', $username) == 1); + return $this->_valid_username($username); } public function _do_login($username, $field_password) @@ -101,21 +182,27 @@ class User extends CI_Controller { $password = $this->input->post('password'); $this->load->model('users_model'); - $res_login = $this->users_model->login($username, $password); + $user = $this->users_model->login($username, $password); + // Authentication failed + if ($user === FALSE) + return FALSE; + // First authentication of a user with LDAP, i.e. the user does not // have an user_id in `users` DB table yet. - if ($res_login === TRUE) + if ($user['auth_src'] == 'ldap_first_time') + { + $this->ldap_user_info = $user; + $this->username = $user['uid'][0]; + $this->email = $user['mail'][0]; return TRUE; - // Authentication failed - else if ($res_login === FALSE) - return FALSE; + } // Authentication when the user has an user_id in the DB. - $this->username = $res_login['username']; - $this->email = $res_login['email']; - $this->user_id = $res_login['id']; - + $this->username = $user['username']; + $this->email = $user['email']; + $this->user_id = $user['id']; + return TRUE; } } diff --git a/application/controllers/video.php b/application/controllers/video.php index 4a15ba5..755de1b 100644 --- a/application/controllers/video.php +++ b/application/controllers/video.php @@ -44,7 +44,7 @@ class Video extends CI_Controller { $data['plugin_type'] = ($plugin === NULL ? 'auto' : $plugin); // Display page. - $params = array( 'title' => $data['video']['title'] . ' -- ' + $params = array( 'title' => $data['video']['title'] . ' – ' . $this->config->item('site_name'), 'css' => array( 'jquery.ui.nsvideo.css', diff --git a/application/helpers/MY_url_helper.php b/application/helpers/MY_url_helper.php new file mode 100644 index 0000000..a661770 --- /dev/null +++ b/application/helpers/MY_url_helper.php @@ -0,0 +1,36 @@ +config->load('localization'); + $countries = $ci->config->item('country_list'); + + $html = ""; + return $html; +} + +function available_languages_dropdown($name, $selection=NULL, $attributes='') +{ + $ci =& get_instance(); + // Use the config file name. + $ci->config->load('p2p-tube'); + $langs = $ci->config->item('available_languages_list'); + + $html = "'; + + return $html; +} + +/* End of file localization_helper.php */ +/* Location: ./application/helpers/localization_helper.php */ \ No newline at end of file diff --git a/application/language/english/article_lang.php b/application/language/english/article_lang.php index 761e696..242fa8b 100644 --- a/application/language/english/article_lang.php +++ b/application/language/english/article_lang.php @@ -1,6 +1,9 @@ + *
  • 'internal' or 'ldap': a DB row
  • + *
  • 'ldap_first_time': LDAP user information
  • + * */ public function login($username, $password) { @@ -41,12 +51,100 @@ class Users_model extends CI_Model { // TODO select only required fields. $query = $this->db->query("SELECT * FROM `users` - WHERE $cond_user AND password = '$enc_password'"); + WHERE $cond_user + AND (auth_src = 'ldap' OR password = '$enc_password')"); + // It is possible that the user has a LDAP account but he's + // authenticating here for the first time so it does not have an entry + // in `users` table. if ($query->num_rows() !== 1) + return $this->ldap_login($username, $password); + + $user = $query->row_array(); + + // Authenticate with LDAP. + if ($user['auth_src'] == 'ldap') + return ($this->ldap_login($username, $password) !== FALSE + ? $user : FALSE); + + // If we are here internal authentication has successful. + return $user; + } + + /** + * Login with LDAP. + * + * @param string $username + * @param string $password + * @return boolean + * @author Alex Herișanu, Răzvan Deaconescu, Călin-Andrei Burloiu + */ + public function ldap_login($username, $password) + { + $this->config->load('ldap'); + + // First connection: binding. + // TODO exception + $ds = ldap_connect($this->config->item('ldap_server')) or die("Can't connect to ldap server.\n"); + if (!@ldap_bind($ds, $this->config->item('ldap_bind_user'), + $this->config->item('ldap_bind_password'))) + { + ldap_close($ds); + die("Can't connect to ".$this->config->item('ldap_server')."\n"); return FALSE; - - return $query->row_array(); + } + $sr = ldap_search($ds, "dc=cs,dc=curs,dc=pub,dc=ro", "(uid=" . $username . ")"); + if (ldap_count_entries($ds, $sr) > 1) + die("Multiple entries with the same uid in LDAP database??"); + if (ldap_count_entries($ds, $sr) < 1) { + ldap_close($ds); + return FALSE; + } + + $info = ldap_get_entries($ds, $sr); + $dn = $info[0]["dn"]; + ldap_close($ds); + + // Second connection: connect with user's credentials. + $ds = ldap_connect($this->config->item('ldap_server')) or die("Can't connect to ldap server\n"); + if (!@ldap_bind($ds, $dn, $password) or $password == '') { + ldap_close($ds); + return FALSE; + } + + // Verifify if DN belongs to the requested OU. + $info[0]['ou_ok'] = $this->ldap_dn_belongs_ou( $dn, $this->config->item('ldap_req_ou') ); + + // Set authentication source. + $info[0]['auth_src'] = 'ldap_first_time'; + + return $info[0]; + } + + /** + * Verify if a user belongs to a group. + * + * @param string $dn = "ou=Student,ou=People..." + * @param array $ou = array ("Student", etc + * @return TRUE or FALSE + * @author Răzvan Herișanu, Răzvan Deaconescu, Călin-Andrei Burloiu + */ + public function ldap_dn_belongs_ou($dn, $ou) + { + if (!is_array($ou)) + $ou = array ($ou); + + $founded = FALSE; + $words = explode(',', $dn); + foreach ($words as $c) { + $parts = explode("=", $c); + $key = $parts[0]; + $value = $parts[1]; + + if (strtolower($key) == "ou" && in_array($value, $ou) ) + $founded = TRUE; + } + return $founded; } } diff --git a/application/views/header.php b/application/views/header.php index 53d68e7..9745938 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -1,16 +1,20 @@ -lang->line('ui_categ_all-categories'); foreach ($this->config->item('categories') as $id => $name) { $categories[$name] = $this->lang->line("ui_categ_$name"); } + // Username + $username = $this->session->userdata('username'); ?> diff --git a/application/views/user/login_view.php b/application/views/user/login_view.php index 4389cdb..2a3f945 100644 --- a/application/views/user/login_view.php +++ b/application/views/user/login_view.php @@ -1,5 +1,4 @@ - - + diff --git a/application/views/user/register_view.php b/application/views/user/register_view.php new file mode 100644 index 0000000..1f77400 --- /dev/null +++ b/application/views/user/register_view.php @@ -0,0 +1,125 @@ + +
    lang->line('user_username_or_email'). ': ' ?>
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    lang->line('user_note_required_fields') ?>
     
    lang->line('user_username'). ' * ' ?> + +
    lang->line('user_password'). ' * ' ?> + +
    lang->line('user_password_confirmation'). ' * ' ?> + +
    lang->line('user_email'). ' * ' ?> + +
     
    lang->line('user_first_name'). ' * ' ?> + +
    lang->line('user_last_name'). ' * ' ?> + +
    lang->line('user_birth_date'). '  ' ?> + (lang->line('user_date_format_hint') ?>) +
    lang->line('user_country'). ' * ' ?> + +
    lang->line('user_locality'). '  ' ?> + +
     
    lang->line('user_ui_lang'). '  ' ?> + +
    lang->line('user_time_zone'). ' * ' ?> + +
     
    + +
    + + + \ No newline at end of file diff --git a/css/default.css b/css/default.css index 852928c..661dbd6 100644 --- a/css/default.css +++ b/css/default.css @@ -29,6 +29,11 @@ h1 table.form th { text-align: right; + /*width: 25%;*/ +} +table.form td +{ + vertical-align: bottom; } .error @@ -36,6 +41,11 @@ table.form th color: red; font-weight:bold; } +.required +{ + color: red; + font-weight:bold; +} .inline { @@ -109,6 +119,21 @@ table.form th color: #FFE4B5; font-weight: bold; } +.menu-greeting +{ + display: block; + height: 12px; + color: #FFE4B5; + text-align: center; + line-height: 100%; + font-size: 14px; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 16px; + padding-right: 16px; + border: 1px solid transparent; + text-decoration: none; +} #header { diff --git a/img/calendar.gif b/img/calendar.gif new file mode 100644 index 0000000000000000000000000000000000000000..d0abaa7c0b892e781b6f553453a0027efea014b9 GIT binary patch literal 269 zcmZ?wbhEHb6kyoJ#dt% zaYstuiRe5}O|8;NEA%ba6j)5k7TbN(gNwC&D)Y{1Cu2PhDy(ymnp7_1Ai(k{X>FbJ zg$yQ1aX#U+v{)u7c4kS5=DdO;0Y*k<=8BdGnYaWYcOkak83LIJ0`39}`h<8zSFc^O QT3n!+Z|k=0I}{nL0T`orxBvhE literal 0 HcmV?d00001 diff --git a/scripts/sync.sh b/scripts/sync.sh new file mode 100755 index 0000000..acf92ff --- /dev/null +++ b/scripts/sync.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +rsync -avz ../ p2p-next@koala.cs.pub.ro:public_html/devel/ -- 2.20.1