Fixed some mistakes.
[squirrelmail.git] / functions / identity.php
CommitLineData
b1f45342 1<?php
2
3/**
4 * identity.php
5 *
6 * Copyright (c) 1999-2003 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * This contains utility functions for dealing with multiple identities
10 *
11 * $Id$
12 *
13 */
14
15if (!defined('SM_PATH')) {
16 define('SM_PATH','../');
17}
18
19include_once(SM_PATH . 'include/load_prefs.php');
20
21/**
22* Returns an array of all the identities.
23* Array is keyed: full_name, reply_to, email_address, index, signature
24*/
25function get_identities() {
26
27 global $username, $data_dir;
28
29 $num_ids = getPref($data_dir,$username,'identities');
30 $identities = array();
31 /* We always have this one, even if the user doesn't use multiple identities */
32 $identities[] = array('full_name' => getPref($data_dir,$username,'full_name'),
33 'email_address' => getPref($data_dir,$username,'email_address'),
34 'reply_to' => getPref($data_dir,$username,'reply_to'),
35 'signature' => getSig($data_dir,$username,'g'),
36 'index' => 0 );
37
38 /* If there are any others, add them to the array */
39 if (!empty($num_ids) && $num_ids > 1) { for ($i=1;$i<$num_ids;$i++) {
40 $identities[] = array('full_name' => getPref($data_dir,$username,'full_name' . $i),
41 'email_address' => getPref($data_dir,$username,'email_address' . $i),
42 'reply_to' => getPref($data_dir,$username,'reply_to' . $i),
43 'signature' => getSig($data_dir,$username,$i),
44 'index' => $i );
45 }
46 }
47
48 return $identities;
49}
50
51?>