IF (ab.alias IS NULL, NULL, CONCAT(ab.alias, \'@' . $globals->mail->domain2 . '\')) AS bestalias_alternate,
a.email, a.full_name, a.directory_name, a.display_name, a.sex = \'female\' AS gender,
IF(a.state = \'active\', CONCAT(at.perms, \',\', IF(a.user_perms IS NULL, \'\', a.user_perms)), \'\') AS perms,
- a.user_perms, a.email_format, a.is_admin, a.state, a.type, a.skin,
+ a.user_perms, a.email_format, a.is_admin, a.state, a.type, at.description AS type_description, a.skin,
FIND_IN_SET(\'watch\', a.flags) AS watch, a.comment,
a.weak_password IS NOT NULL AS weak_access, g.g_account_name IS NOT NULL AS googleapps,
a.token IS NOT NULL AS token_access, a.token, a.last_version,
return $this->profile()->promo();
}
+ public function category()
+ {
+ $promo = $this->promo();
+ if (!empty($promo)) {
+ return $promo;
+ } else {
+ return $this->type_description;
+ }
+ }
+
public function firstName()
{
if (!$this->hasProfile()) {
INNER JOIN account_profiles AS ap ON (ap.uid = pd.pid AND FIND_IN_SET('owner', perms))
WHERE a.uid = ap.uid);
-ALTER TABLE account_types
+ ALTER TABLE account_types
CHANGE COLUMN perms perms SET('groups', 'mail', 'directory_ax', 'directory_private',
- 'edit_directory', 'forums', 'lists', 'payment') NOT NULL;
+ 'edit_directory', 'forums', 'lists', 'payment') NOT NULL,
+ ADD COLUMN description TEXT DEFAULT NULL;
-REPLACE INTO account_types VALUES ('x', 'groups,mail,directory_private,forums,lists,payment'),
- ('master', 'groups,directory_private,forums,lists,payment'),
- ('phd', 'groups,directory_private,forums,lists,payment'),
- ('pi', 'groups,forums,lists'),
- ('ax', 'groups,directory_ax,edit_directory'),
- ('xnet', 'groups'),
- ('school', 'groups,directory_ax'),
- ('fx', 'groups,directory_ax'),
- ('virtual', '');
+REPLACE INTO account_types VALUES ('x', 'groups,mail,directory_private,forums,lists,payment', 'Polytechnicien'),
+ ('master', 'groups,directory_private,forums,lists,payment', 'Master de l\'X'),
+ ('phd', 'groups,directory_private,forums,lists,payment', 'Docteur de l\'X'),
+ ('pi', 'groups,forums,lists', 'Elève du programme international'),
+ ('ax', 'groups,directory_ax,edit_directory', 'Secrétariat de l\'AX'),
+ ('xnet', 'groups', NULL),
+ ('school', 'groups,directory_ax', 'Personnel de l\'X'),
+ ('fx', 'groups,directory_ax', 'Personnel de la FX'),
+ ('virtual', '', NULL);
-- vim:set syntax=mysql: