Author Topic: [Patch to SVN508] Add prefix into username login form.  (Read 6885 times)

Offline christophe_d13

  • Newbie
  • *
  • Posts: 1
[Patch to SVN508] Add prefix into username login form.
« on: March 18, 2007, 06:45:55 AM »
I'm bored to always type the prefix in my webmail login form...

Example :
ID : jocatop-christophe
Pass : XXXXXX

ID : jocatop-pierre
Pass : XXXXX

ID : jocatop-robert
...

It's very boring to always type the prefix "jocatop-".
Now, it's better !

This patch is based on the SVN 508.



program/include/main.inc

Before :
Code: [Select]
function rcmail_login($user, $pass, $host=NULL)
 {
 global $CONFIG, $IMAP, $DB, $sess_user_lang;
 $user_id = NULL;
 
 if (!$host)
  $host = $CONFIG['default_host'];

 // Validate that selected host is in the list of configured hosts
 if (is_array($CONFIG['default_host']))
  {


After :
Code: [Select]
function rcmail_login($user, $pass, $host=NULL)
 {
 global $CONFIG, $IMAP, $DB, $sess_user_lang;
 $user_id = NULL;

 if (!empty($CONFIG['login_username_prefix']))
  $user = $CONFIG['login_username_prefix'].str_replace ( $CONFIG['login_username_prefix'], "", $user );
 
 if (!$host)
  $host = $CONFIG['default_host'];

 // Validate that selected host is in the list of configured hosts
 if (is_array($CONFIG['default_host']))
  {


config/main.inc.php

Simple add these lines :
Code: [Select]
// Enable prefix use for username in the login form.
$rcmail_config['login_username_prefix'] = ''; //sample : 'jocatop-'

Offline rosso

  • Newbie
  • *
  • Posts: 1
some things changed a little bit :)
« Reply #1 on: July 08, 2009, 03:42:53 AM »
$CONFIG changed to $config

and it is in the program/include/rcmail.php

Good luck