* * Licensed under the GNU GPL. For full terms see the file COPYING. * * Alexandros Vellis' Version for use with the ldapuserdata plugin and * attributes such as mailAlternateAddress, mailAuthorizedAddress. * * National & Kapodistrian University of Athens * http://email.uoa.gr * * Display Identities Options * */ if (file_exists('../../include/init.php')) { include_once('../../include/init.php'); } else if (file_exists('../../include/validate.php')) { define('SM_PATH','../../'); require_once(SM_PATH . 'include/validate.php'); } require_once(SM_PATH . 'functions/display_messages.php'); require_once(SM_PATH . 'functions/html.php'); require_once(SM_PATH . 'functions/identity.php'); $ldapidentities = $_SESSION['ldapidentities']; $identities_map = $_SESSION['identities_map']; /* User's current identity preferences */ $identity = getpref($data_dir, $username, 'identity'); $namepreferred = getpref($data_dir, $username, 'namepreferred'); $em_preferred = getpref($data_dir, $username, 'mailpreferred'); /* defining $selection */ if(isset($_POST['selection'])) { $selection = $_POST['selection']; } elseif(!empty($em_preferred)) { if(in_array($em_preferred, $ldapidentities['main']['email_address'])){ $selection = 'main'; } else { $selection = $em_preferred; } } else { $selection = 'main'; } /* Default email identity (full_name, email_address) */ $full_name = getpref($data_dir, $username, 'full_name'); $email_address = getpref($data_dir, $username, 'email_address'); $id_default = $full_name.' <'.$email_address.'>'; if (isset($_POST['update'])) { if($selection == 'main') { removePref($data_dir, $username, 'identity'); removePref($data_dir, $username, 'mailpreferred'); removePref($data_dir, $username, 'namepreferred'); if(isset($ldapidentities['main']['allowed_names'])){ $_SESSION['alternatenames'] = $ldapidentities['main']['allowed_names']; } } elseif(in_array($selection, $identities_map)) { foreach($identities_map as $no=>$mail) { if($mail == $selection) { setPref($data_dir, $username, 'identity', $no); setPref($data_dir, $username, 'mailpreferred', $selection); /* Set a default name... */ if(isset($ldapidentities[$selection]['allowed_names'])){ setPref($data_dir, $username, 'namepreferred', $ldapidentities[$selection]['allowed_names'][0]); } } } if(isset($ldapidentities[$selection]['allowed_names'])){ $_SESSION['alternatenames'] = $ldapidentities[$selection]['allowed_names']; } } else { print "Wrong identity specified."; exit; } header('Location: ../../src/options.php?optpage=personal'); exit; } displayPageHeader($color, 'None'); print '
'; print _("Options") . ' - ' . _("Advanced Identities"); $prev = sq_bindtextdomain ('ldapudidentities', SM_PATH . 'plugins/ldapuserdata/locale'); textdomain ('ldapudidentities'); print '

'. _("This page allows you to choose between a default mail identity for this system, and one of the identities which you have been authorized to send mail as.") . '

'. _("Authorized mail identities are provided by the mail administrators on demand, in order to allow certain users to use third-party or non-returnable addresses.") . '

'. _("Note that you can always choose a specific identity on-the-fly, while composing a new mail.") . '

'; if(isset($ldapidentities)) { print '
'; echo ''; /* All email addresses */ foreach($ldapidentities as $id => $info) { if($id == 'main') { /* Main (mail/mailalternate) Identities */ print ""; print "\n"; echo "\n"; } else { /* Informational Text */ if(!isset($mailauthorized_blurb)) { $mailauthorized_blurb = true; print "". "\n". "\n". ''; } $prev = sq_bindtextdomain ('squirrelmail', SM_PATH . 'locale'); textdomain ('squirrelmail'); ?>
". '' . _("Main Identity") . ''. "
"; print ''; print '
'; echo "
 
". '' . _("Authorized Identities") . ''. "
". '

'. _("The rest of the identities have been provided as a means for you to send mail using specific names and addresses. If other users on the Internet reply to you while you have used these email addresses, it is not certain that the mail will return to the mailbox of this specific account; you will have to check that specific mail account, or set up mail forwarding accordingly, by yourself. Also, it is possible that other users on this system or in the Internet are using the same email addresses as these.") . '

'. '

'; // $ldapidentitiescontact = '210 727 5600 / helpdesk@noc.uoa.gr'; $ldapidentitiescontact = 'email@edunet.gr'; printf(_("For more information about authorized identities, please contact our support staff at: %s"), $ldapidentitiescontact); print '

'; } /* mailauthorized Identities */ print ' '; print '
'; } } echo "
". '

'. "