| 1 | <?php |
| 2 | /******************************************************************************** |
| 3 | * install.d/profile.inc.php : class for posts |
| 4 | * ----------------------- |
| 5 | * |
| 6 | * This file is part of the banana distribution |
| 7 | * Copyright: See COPYING files that comes with this distribution |
| 8 | ********************************************************************************/ |
| 9 | |
| 10 | /** checkcancel : sets cancel rights |
| 11 | * @param $_headers OBJECT headers of message to cancel |
| 12 | * @return BOOLEAN true if user has right to cancel message |
| 13 | */ |
| 14 | function checkcancel($_headers) { |
| 15 | return ($_headers->from == $_SESSION['name']." <".$_SESSION['mail'].">"); |
| 16 | } |
| 17 | |
| 18 | /** getprofile : sets profile variables |
| 19 | * @return ARRAY associative array. Keys are 'name' (name), 'sig' (signature), 'org' |
| 20 | * (organization), 'display' (display threads with new posts only or all threads), |
| 21 | * 'lastnews' (timestamp for empasizing new posts) |
| 22 | */ |
| 23 | |
| 24 | function getprofile() { |
| 25 | $array['name'] = $_SESSION['name']." <".htmlentities($_SESSION['mail']).">"; |
| 26 | $array['sig'] = $_SESSION['sig']; |
| 27 | $array['org'] = $_SESSION['org']; |
| 28 | $array['customhdr'] = ""; |
| 29 | $array['display'] = $_SESSION['displaytype']; |
| 30 | $array['lastnews'] = time()-86400; |
| 31 | $array['locale'] = 'fr'; |
| 32 | $array['subscribe'] = array(); |
| 33 | $array['dropsig'] = true; |
| 34 | |
| 35 | setlocale(LC_MESSAGE, $array['locale']); |
| 36 | setlocale(LC_TIME, $array['locale']); |
| 37 | return $array; |
| 38 | } |
| 39 | ?> |