ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjiLincUserGUI Class Reference

Class ilObjiLincUserGUI iLinc related user settings. More...

+ Collaboration diagram for ilObjiLincUserGUI:

Public Member Functions

 ilObjiLincUserGUI (&$a_user_obj, &$a_usrf_ref_id)
 Constructor @access public. More...
 
executeCommand ()
 
 view ()
 
 cancel ()
 
 save ()
 
 __initSubTabs ($a_cmd)
 

Detailed Description

Class ilObjiLincUserGUI iLinc related user settings.

Author
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
$Id$

Definition at line 38 of file class.ilObjiLincUserGUI.php.

Member Function Documentation

◆ __initSubTabs()

ilObjiLincUserGUI::__initSubTabs (   $a_cmd)

Definition at line 222 of file class.ilObjiLincUserGUI.php.

223 {
224 global $ilTabs;
225
226 $perm = ($a_cmd == 'perm') ? true : false;
227 $info = ($a_cmd == 'info') ? true : false;
228 $owner = ($a_cmd == 'owner') ? true : false;
229
230 $ilTabs->addSubTabTarget("permission_settings", $this->ctrl->getLinkTarget($this, "perm"),
231 "", "", "", $perm);
232 $ilTabs->addSubTabTarget("info_status_info", $this->ctrl->getLinkTarget($this, "info"),
233 "", "", "", $info);
234 $ilTabs->addSubTabTarget("owner", $this->ctrl->getLinkTarget($this, "owner"),
235 "", "", "", $owner);
236 }

◆ cancel()

ilObjiLincUserGUI::cancel ( )

Definition at line 172 of file class.ilObjiLincUserGUI.php.

173 {
174 ilSession::clear("saved_post");
175
176 ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
177
178 if(strtolower($_GET["baseClass"]) == 'iladministrationgui')
179 {
180 $this->ctrl->redirectByClass("ilobjusergui", "view");
181 }
182 else
183 {
184 $this->ctrl->redirectByClass('ilobjcategorygui','listUsers');
185 }
186 }
$_GET["client_id"]
static clear($a_var)
Unset a value.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, ilSession\clear(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ executeCommand()

& ilObjiLincUserGUI::executeCommand ( )

Definition at line 75 of file class.ilObjiLincUserGUI.php.

76 {
77 global $rbacsystem, $ilErr;
78
79 // User folder
80 if($this->usrf_ref_id == USER_FOLDER_ID and !$rbacsystem->checkAccess('visible,read',$this->usrf_ref_id))
81 {
82 $this->ilias->raiseError($this->lng->txt("msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
83 }
84 // if called from local administration $this->usrf_ref_id is category id
85 // Todo: this has to be fixed. Do not mix user folder id and category id
86 if($this->usrf_ref_id != USER_FOLDER_ID)
87 {
88 // check if user is assigned to category
89 if(!$rbacsystem->checkAccess('cat_administrate_users',$this->user->getTimeLimitOwner()))
90 {
91 $this->ilias->raiseError($this->lng->txt("msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
92 }
93 }
94
95 $next_class = $this->ctrl->getNextClass($this);
96
97 switch($next_class)
98 {
99 default:
100 $cmd = $this->ctrl->getCmd();
101
102 if ($cmd == '')
103 {
104 $cmd = "view";
105 }
106
107 $this->$cmd();
108 break;
109 }
110
111 return true;
112 }
const USER_FOLDER_ID
Class ilObjUserFolder.
redirection script todo: (a better solution should control the processing via a xml file)
$cmd
Definition: sahs_server.php:35

References $cmd, $ilErr, and USER_FOLDER_ID.

◆ ilObjiLincUserGUI()

ilObjiLincUserGUI::ilObjiLincUserGUI ( $a_user_obj,
$a_usrf_ref_id 
)

Constructor @access public.

Parameters
array??
integerobject id
booleancall be reference

Definition at line 47 of file class.ilObjiLincUserGUI.php.

48 {
49 global $ilias, $tpl, $ilCtrl, $ilErr, $lng;
50
51 if (!isset($ilErr))
52 {
53 $ilErr = new ilErrorHandling();
54 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
55 }
56 else
57 {
58 $this->ilErr =& $ilErr;
59 }
60
61 $this->ilias =& $ilias;
62 $this->tpl =& $tpl;
63 $this->lng =& $lng;
64 $this->ctrl =& $ilCtrl;
65
66 $this->lng->loadLanguageModule('ilinc');
67
68 $this->usrf_ref_id =& $a_usrf_ref_id;
69
70 $this->user =& $a_user_obj;
71
72 $this->ilinc_user = new ilObjiLincUser($a_user_obj);
73 }
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
global $tpl
Definition: ilias.php:8
Error Handling & global info handling uses PEAR error class.
Class ilObjiLincUser iLinc related user settings.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40

References $ilCtrl, $ilErr, $lng, $tpl, and PEAR_ERROR_CALLBACK.

◆ save()

ilObjiLincUserGUI::save ( )

Definition at line 188 of file class.ilObjiLincUserGUI.php.

189 {
190 if (!$this->ilinc_user->id)
191 {
192 $this->ilinc_user->setVar('akuservalue1',$_POST['Fobject']['ilinc_akuservalue1']);
193 $this->ilinc_user->setVar('akuservalue2',$_POST['Fobject']['ilinc_akuservalue2']);
194
195 if (!$this->ilinc_user->add())
196 {
197 $this->ilErr->raiseError($this->ilinc_user->getErrorMsg(),$this->ilErr->MESSAGE);
198 }
199
200 $info_message = $this->lng->txt("ilinc_user_added");
201 }
202 else
203 {
204 $this->ilinc_user->setVar('akuservalue1',$_POST['Fobject']['ilinc_akuservalue1']);
205 $this->ilinc_user->setVar('akuservalue2',$_POST['Fobject']['ilinc_akuservalue2']);
206
207 if (!$this->ilinc_user->edit())
208 {
209 $this->ilErr->raiseError($this->ilinc_user->getErrorMsg(),$this->ilErr->MESSAGE);
210 }
211
212 $info_message = $this->lng->txt("ilinc_akuservalues_refreshed");
213 }
214
215 ilUtil::sendInfo($info_message,true);
216
217 $this->ctrl->redirectByClass("ilobjilincusergui", "view");
218 }
$_POST['username']
Definition: cron.php:12

References $_POST, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ view()

ilObjiLincUserGUI::view ( )

Definition at line 114 of file class.ilObjiLincUserGUI.php.

115 {
116 // return iLinc user account data if user already exists on iLinc server
117 if ($this->ilinc_user->id)
118 {
119 if (!$data = $this->ilinc_user->find($this->ilinc_user->id))
120 {
121 $this->ilErr->raiseError($this->ilinc_user->getErrorMsg(),$this->ilErr->MESSAGE);
122 }
123
124 $this->ilinc_user->setVar('akuservalue1',$data['users'][$this->ilinc_user->id]['akuservalue1']);
125 $this->ilinc_user->setVar('akuservalue2',$data['users'][$this->ilinc_user->id]['akuservalue2']);
126 }
127
128 if (!$this->ilinc_user->id)
129 {
130 $ilinc_id = $this->lng->txt("ilinc_no_account_yet");
131 $ilinc_login = $ilinc_id;
132 $ilinc_passwd = $ilinc_id;
133
134 $submit_button_title = $this->lng->txt("ilinc_add_user");
135 }
136 else
137 {
138 $ilinc_id = $this->ilinc_user->id;
139 $ilinc_login = $this->ilinc_user->login;
140 $ilinc_passwd = $this->ilinc_user->passwd;
141
142 $submit_button_title = $this->lng->txt("refresh");
143 }
144
145 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.icrs_usr_edit.html","Modules/ILinc");
146
147 $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
148 $this->tpl->setVariable("TXT_HEADER", $this->lng->txt("ilinc_user_settings"));
149 $this->tpl->setVariable("TXT_LOGIN_DATA", $this->lng->txt("login_data"));
150 $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
151
152 $this->tpl->setVariable("TXT_SUBMIT", $submit_button_title);
153 $this->tpl->setVariable("CMD_SUBMIT", "save");
154
155 $this->tpl->setVariable("TXT_ILINC_ID", $this->lng->txt("ilinc_user_id"));
156 $this->tpl->setVariable("ILINC_ID", $ilinc_id);
157 $this->tpl->setVariable("TXT_ILINC_LOGIN", $this->lng->txt("login"));
158 $this->tpl->setVariable("ILINC_LOGIN", $ilinc_login);
159 /*
160 $this->tpl->setVariable("TXT_ILINC_PASSWD", $this->lng->txt("passwd"));
161 $this->tpl->setVariable("ILINC_PASSWD", $ilinc_passwd);
162 */
163
164 $this->tpl->setVariable("TXT_ILINC_AKUSERVALUES", $this->lng->txt("ilinc_akuservalues"));
165 $this->tpl->setVariable("TXT_ILINC_AKUSERVALUES_DESC", $this->lng->txt("ilinc_akuservalues_desc"));
166 $this->tpl->setVariable("TXT_ILINC_AKUSERVALUE1", $this->lng->txt("ilinc_akuservalue1"));
167 $this->tpl->setVariable("ILINC_AKUSERVALUE1", $this->ilinc_user->akuservalue1);
168 $this->tpl->setVariable("TXT_ILINC_AKUSERVALUE2", $this->lng->txt("ilinc_akuservalue2"));
169 $this->tpl->setVariable("ILINC_AKUSERVALUE2", $this->ilinc_user->akuservalue2);
170 }

References $data.


The documentation for this class was generated from the following file: