f7d96d799145c7aee9b69e5427092f4124035e1a
[freeside.git] / fs_selfservice / fri / modules / myaccount.module
1 <?php
2
3 /**
4  * @file
5  * Functions for the interface to the help page
6  */
7
8 /**
9   * Class for help
10   */
11 class myaccount {
12
13   /*
14    * rank (for prioritizing modules)
15    */
16   function rank() {
17
18     $rank = 9;
19     return $rank;
20   }
21
22   /*
23    * init
24    */
25   function init() {
26   }
27
28   /*
29    * Adds menu item to nav menu
30    *
31    * @param $args
32    *   Common arguments
33    */
34   function navMenu($args) {
35
36     $ret .= "<p><small><small><a href='" . $_SESSION['ARI_ROOT'] . "?m=myaccount&f=display'>" . _("My Account") . "</a></small></small></p><br>";
37
38     return $ret;
39   }
40
41   /*
42    * Displays stats page
43    *
44    * @param $args
45    *   Common arguments
46    */
47   function display($args) {
48
49     global $ARI_HELP_FEATURE_CODES;
50
51     $display = new Display();
52
53     // args
54     $m = getArgument($args,'m');
55     $q = getArgument($args,'q');
56
57     $displayname = $_SESSION['ari_user']['displayname'];
58     $extension = $_SESSION['ari_user']['extension'];
59
60     // build page content
61     $ret .= checkErrorMessage();
62
63         $header_text = _("My Account");
64         if (!$_SESSION['ari_user']['admin_help']) {
65                 $header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension);
66         }
67
68     // build page content
69     $ret .= checkErrorMessage();
70
71     $ret .= $display->displayHeaderText($header_text);
72     $ret .= $display->displayLine();
73
74     $freeside = new FreesideSelfService();
75     $fs_info = $freeside->customer_info( array(
76       'session_id' => $_SESSION['freeside_session_id'],
77     ) );
78     $error = $fs_info['error'];
79     if ( $error ) {
80       //$_SESSION['ari_error'] = _("Incorrect Username or Password");
81       $_SESSION['ari_error'] = $error; #// XXX report as ari_error???!
82     }
83
84     $ret .= $fs_info['small_custview'];
85     $ret .= '<BR>';
86
87
88
89
90     return $ret;
91   }
92
93 }
94
95 ?>