| 1 |
<?php |
<?php |
| 2 |
/* $Id: rcmail.module,v 1.2.2.1 2007/03/24 12:59:17 polyformalsp Exp $ */ |
/* $Id: rcmail.module polyformal Exp $ */ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 24 |
} |
} |
| 25 |
} |
} |
| 26 |
|
|
| 27 |
function rcmail_settings() { |
function rcmail_admin_settings() { |
| 28 |
// only administrators can access this function |
// only administrators can access this function |
| 29 |
if (!user_access('adminster rcmail')) { |
/*if (!user_access('adminster rcmail')) { |
| 30 |
return message_access(); |
return message_access(); |
| 31 |
} |
}*/ |
| 32 |
|
|
| 33 |
$form["rcmail_iframe_width"] = array( |
$form["rcmail_iframe_width"] = array( |
| 34 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 47 |
'#maxlength' => 15, |
'#maxlength' => 15, |
| 48 |
'#description' => t("Enter width of the iframe. Optimum is 550px"), |
'#description' => t("Enter width of the iframe. Optimum is 550px"), |
| 49 |
); |
); |
| 50 |
return $form; |
return system_settings_form($form); |
| 51 |
} |
} |
| 52 |
|
|
| 53 |
function rcmail_perm() { |
function rcmail_perm() { |
| 55 |
} |
} |
| 56 |
|
|
| 57 |
/** |
/** |
|
* hook_menu() implementation |
|
|
*/ |
|
|
|
|
|
|
|
|
/** |
|
| 58 |
* Implementation of hook_user(). |
* Implementation of hook_user(). |
| 59 |
* |
* |
| 60 |
* Grab the settings of the imap account for each user |
* Grab the settings of the imap account for each user |
| 77 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 78 |
'#title' => t('user'), |
'#title' => t('user'), |
| 79 |
'#default_value' => $edit['rcmail_username'], |
'#default_value' => $edit['rcmail_username'], |
| 80 |
'#size' => 20, |
'#size' => 30, |
| 81 |
'#maxlength' => 20, |
'#maxlength' => 40, |
| 82 |
'#description' => t('Enter the username of your IMAP account.'), |
'#description' => t('Enter the username of your IMAP account.'), |
| 83 |
); |
); |
| 84 |
|
|
| 86 |
'#type' => 'password', |
'#type' => 'password', |
| 87 |
'#title' => t('password'), |
'#title' => t('password'), |
| 88 |
'#default_value' => $dec, |
'#default_value' => $dec, |
| 89 |
'#size' => 20, |
'#size' => 30, |
| 90 |
'#maxlength' => 20, |
'#maxlength' => 40, |
| 91 |
'#required' => TRUE, |
'#required' => TRUE, |
| 92 |
'#description' => t('Enter your the password of your IMAP account.'), |
'#description' => t('Enter your the password of your IMAP account.'), |
| 93 |
); |
); |
| 96 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 97 |
'#title' => t('server'), |
'#title' => t('server'), |
| 98 |
'#default_value' => $edit['rcmail_server'], |
'#default_value' => $edit['rcmail_server'], |
| 99 |
'#size' => 20, |
'#size' => 30, |
| 100 |
'#maxlength' => 20, |
'#maxlength' => 40, |
| 101 |
'#description' => t('Enter the servername of your IMAP account.'), |
'#description' => t('Enter the servername of your IMAP account.'), |
| 102 |
); |
); |
|
|
|
| 103 |
return $form; |
return $form; |
|
|
|
| 104 |
} //eof if |
} //eof if |
| 105 |
|
|
| 106 |
case 'update': |
case 'update': |
| 111 |
/** |
/** |
| 112 |
* hook_menu() implementation |
* hook_menu() implementation |
| 113 |
*/ |
*/ |
| 114 |
function rcmail_menu() { |
function rcmail_menu($may_cache) { |
| 115 |
$items[] = array( |
$items = array(); |
| 116 |
'path' => 'rcmail', |
if ($may_cache) { |
| 117 |
'title' => t('roundcubemail'), |
$items[] = array( |
| 118 |
'callback' => 'rcmail_page', |
'path' => 'rcmail', |
| 119 |
'access' => (user_access('use rcmail')) |
'title' => t('roundcubemail'), |
| 120 |
|
'callback' => 'rcmail_page', |
| 121 |
|
'access' => (user_access('use rcmail')) |
| 122 |
); |
); |
| 123 |
|
$items[] = array( |
| 124 |
|
'path' => 'admin/settings/rcmail', |
| 125 |
|
'title' => t('rcmail settings'), |
| 126 |
|
'description' => t('Configure roundcube appearance (height an width of the iframe).'), |
| 127 |
|
'callback' => 'drupal_get_form', |
| 128 |
|
'callback arguments' => 'rcmail_admin_settings', |
| 129 |
|
'access' => user_access('administer site configuration'), |
| 130 |
|
'type' => MENU_NORMAL_ITEM, |
| 131 |
|
); |
| 132 |
|
} |
| 133 |
return $items; |
return $items; |
| 134 |
} |
} |
| 135 |
|
|
| 178 |
$enc = base64_encode($enc); |
$enc = base64_encode($enc); |
| 179 |
return $enc; |
return $enc; |
| 180 |
} |
} |
|
|
|
| 181 |
?> |
?> |