PageRenderTime 60ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/saf/lib/Session/Manager.php

https://github.com/lux/siteforge
PHP | 1673 lines | 863 code | 472 blank | 338 comment | 36 complexity | fb7285ef8e80038d14c9c483b0f36f9d MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, Apache-2.0
  1. <?php
  2. loader_import ('saf.File');
  3. /**
  4. * @package Session
  5. */
  6. class SessionManager {
  7. function SessionManager () {
  8. $this->user = new SessionManager_User;
  9. $this->role = new SessionManager_Role;
  10. $this->team = new SessionManager_Team;
  11. $this->resource = new SessionManager_Resource;
  12. $this->access = new SessionManager_Access;
  13. $this->status = new SessionManager_Status;
  14. $this->pref = new SessionManager_Pref;
  15. }
  16. }
  17. /**
  18. * @package Session
  19. */
  20. class SessionManager_User {
  21. /* Format: Dependent on Session Source driver */
  22. /**
  23. * Number of users.
  24. */
  25. var $total;
  26. /**
  27. * Error message, if an error occurs.
  28. */
  29. var $error;
  30. /**
  31. * Returns a list of users.
  32. *
  33. * @return array
  34. */
  35. function getList ($offset = false, $limit = false, $order, $ascdesc, $role = false, $team = false, $name = false, $disabled = false, $public = false, $teams = false) {
  36. $res = session_user_get_list ($offset, $limit, $order, $ascdesc, $role, $team, $name, $disabled, $public, $teams);
  37. if (! $res) {
  38. $this->error = session_user_error ();
  39. return false;
  40. }
  41. $this->total = session_user_total ();
  42. return $res;
  43. }
  44. /**
  45. * Adds a user to the system.
  46. *
  47. * @param array hash
  48. * @return boolean
  49. */
  50. function add ($data) {
  51. $res = session_user_add ($data);
  52. if (! $res) {
  53. $this->error = session_user_error ();
  54. }
  55. return $res;
  56. }
  57. /**
  58. * Modifies a user in the system.
  59. *
  60. * @param string
  61. * @param array hash
  62. * @return boolean
  63. */
  64. function edit ($user, $data) {
  65. $res = session_user_edit ($user, $data);
  66. if (! $res) {
  67. $this->error = session_user_error ();
  68. }
  69. return $res;
  70. }
  71. /**
  72. * Deletes a user from the system.
  73. *
  74. * @param string
  75. * @return boolean
  76. */
  77. function delete ($user) {
  78. $res = session_user_delete ($user);
  79. if (! $res) {
  80. $this->error = session_user_error ();
  81. }
  82. return $res;
  83. }
  84. /**
  85. * Generate a form for adding items to this list.
  86. *
  87. * @return object saf.MailForm object
  88. */
  89. function &getAddForm () {
  90. loader_import ('saf.MailForm');
  91. $form = new MailForm;
  92. $form->action = site_prefix () . '/index/usradm-add-user-action';
  93. $form->error_mode = 'all';
  94. loader_import ('ext.phpsniff');
  95. $sniffer = new phpSniff;
  96. $form->_browser = $sniffer->property ('browser');
  97. $form->addWidget ('hidden', '_list');
  98. page_add_script ('
  99. formhelp_prepend = \'<table border="0" cellpadding="0"><tr><td width="12" valign="top"><img src="' . site_prefix () . '/inc/app/cms/pix/arrow-10px.gif" alt="" border="0" /></td><td valign="top">\';
  100. formhelp_append = \'</td></tr></table>\';
  101. ');
  102. $w =& $form->addWidget ('tab', 'tab1');
  103. $w->title = intl_get ('Account');
  104. //$w =& $form->addWidget ('section', 'section1');
  105. //$w->title = intl_get ('Basic Information (Required)');
  106. $w =& $form->addWidget ('text', '_username');
  107. $w->alt = intl_get ('Username');
  108. $w->addRule ('not empty', intl_get ('Username must not be empty.'));
  109. $w->addRule ('unique "sitellite_user/username"', intl_get ('Username already in use.'));
  110. $w->extra = 'maxlength="48"';
  111. $w =& $form->addWidget ('password', 'passwd');
  112. $w->alt = intl_get ('Password');
  113. $w->addRule ('not empty', intl_get ('Password must not be empty.'));
  114. $w->ignoreEmpty = false;
  115. $w =& $form->addWidget ('password', 'password_verify');
  116. $w->alt = intl_get ('Verify Password');
  117. $w->addRule ('equals "passwd"', intl_get ('Passwords do not match.'));
  118. $w->ignoreEmpty = false;
  119. $w =& $form->addWidget ('text', 'firstname');
  120. $w->alt = intl_get ('First Name');
  121. //$w->addRule ('not empty', intl_get ('First name must not be empty.'));
  122. $w->extra = 'maxlength="32"';
  123. $w =& $form->addWidget ('text', 'lastname');
  124. $w->alt = intl_get ('Last Name');
  125. //$w->addRule ('not empty', intl_get ('Last name must not be empty.'));
  126. $w->extra = 'maxlength="32"';
  127. $w =& $form->addWidget ('text', 'email');
  128. $w->alt = intl_get ('Email');
  129. //$w->addRule ('not empty', intl_get ('Email must not be empty.'));
  130. //$w->addRule ('contains "@"', intl_get ('Email does not appear to be valid.'));
  131. $w->extra = 'maxlength="42"';
  132. $snm =& session_get_manager ();
  133. $list = assocify (array_keys ($snm->role->getList ()));
  134. unset ($list['anonymous']);
  135. unset ($list['']);
  136. $w =& $form->addWidget ('select', 'role');
  137. $w->alt = intl_get ('Role');
  138. $w->setValues ($list);
  139. $w->extra = 'id="role"';
  140. $w =& $form->addWidget ('select', 'team');
  141. $w->alt = intl_get ('Team');
  142. $w->setValues (assocify (array_keys ($snm->team->getList ())));
  143. $w->extra = 'id="team"';
  144. $w =& $form->addWidget ('select', 'disabled');
  145. $w->alt = intl_get ('Disabled');
  146. $w->setValues (array ('yes' => 'Yes', 'no' => 'No'));
  147. $w->setValue ('no');
  148. $w->extra = 'id="disabled"';
  149. $w =& $form->addWidget ('select', 'public');
  150. $w->alt = intl_get ('Public');
  151. $w->setValues (array ('yes' => 'Yes', 'no' => 'No'));
  152. $w->setValue ('no');
  153. $w->extra = 'id="public"';
  154. $w =& $form->addWidget ('textarea', 'profile');
  155. $w->alt = intl_get ('Profile');
  156. $w->labelPosition = 'left';
  157. $w->rows = 5;
  158. $w->extra = 'id="profile"';
  159. $w =& $form->addWidget ('textarea', 'sig');
  160. $w->alt = intl_get ('Signature (for comments)');
  161. $w->labelPosition = 'left';
  162. $w->rows = 3;
  163. $w->extra = 'id="sig"';
  164. $w =& $form->addWidget ('tab', 'tab2');
  165. $w->title = intl_get ('Contact');
  166. //$w =& $form->addWidget ('section', 'section2');
  167. //$w->title = intl_get ('Extended Information (Optional)');
  168. $w =& $form->addWidget ('text', 'company');
  169. $w->alt = intl_get ('Company');
  170. $w->extra = 'maxlength="48"';
  171. $w =& $form->addWidget ('text', 'position');
  172. $w->alt = intl_get ('Position');
  173. $w->extra = 'maxlength="48"';
  174. $w =& $form->addWidget ('text', 'website');
  175. $w->alt = intl_get ('Web Site');
  176. $w->setValue ('http://');
  177. $w->extra = 'maxlength="72"';
  178. $w =& $form->addWidget ('text', 'phone');
  179. $w->alt = intl_get ('Phone #');
  180. $w->extra = 'maxlength="24"';
  181. $w =& $form->addWidget ('text', 'cell');
  182. $w->alt = intl_get ('Cell #');
  183. $w->extra = 'maxlength="24"';
  184. $w =& $form->addWidget ('text', 'fax');
  185. $w->alt = intl_get ('Fax #');
  186. $w->extra = 'maxlength="24"';
  187. $w =& $form->addWidget ('text', 'sms_address');
  188. $w->alt = intl_get ('SMS #');
  189. $w->extra = 'maxlength="72"';
  190. $w =& $form->addWidget ('text', 'jabber_id');
  191. $w->alt = intl_get ('Jabber ID');
  192. $w->extra = 'maxlength="48"';
  193. $w =& $form->addWidget ('text', 'address1');
  194. $w->alt = intl_get ('Address');
  195. $w->extra = 'maxlength="72"';
  196. $w =& $form->addWidget ('text', 'address2');
  197. $w->alt = intl_get ('Address Line 2');
  198. $w->extra = 'maxlength="72"';
  199. $w =& $form->addWidget ('text', 'city');
  200. $w->alt = intl_get ('City');
  201. $w->extra = 'maxlength="48"';
  202. $w =& $form->addWidget ('text', 'province');
  203. $w->alt = intl_get ('Province/State');
  204. $w->extra = 'maxlength="48"';
  205. $w =& $form->addWidget ('text', 'postal_code');
  206. $w->alt = intl_get ('Postal/Zip Code');
  207. $w->extra = 'maxlength="16"';
  208. $w =& $form->addWidget ('text', 'country');
  209. $w->alt = intl_get ('Country');
  210. $w->extra = 'maxlength="48"';
  211. $w =& $form->addWidget ('tab', 'tab3');
  212. $w->title = intl_get ('Access');
  213. $w =& $form->addWidget ('usradm.Widget.Allowedbox', 'teams');
  214. $w->alt = 'Allowed Teams';
  215. $w->headers[] = '&nbsp;';
  216. $w->headers[] = intl_get ('Read');
  217. $w->headers[] = intl_get ('Write');
  218. $b =& $w->addButton ('all', array ('r' => '', 'w' => ''));
  219. $b->alt = '<strong>All</strong>';
  220. $b->setValue (array ('r', 'w'));
  221. foreach (session_get_teams () as $value) {
  222. $b =& $w->addButton ($value, array ('r' => '', 'w' => ''));
  223. $b->alt = ucwords (str_replace ('_', ' ', $value));
  224. }
  225. $w =& $form->addWidget ('tab', 'tab-end');
  226. $w =& $form->addWidget ('msubmit', 'submit_button');
  227. $b =& $w->getButton ();
  228. $b->setValues (intl_get ('Save'));
  229. $b =& $w->addButton ('cancel_button');
  230. $b->setValues (intl_get ('Cancel'));
  231. $b->extra = 'onclick="window.location.href = \'' . site_prefix () . '/index/usradm-browse-action?list=users\'; return false"';
  232. return $form;
  233. }
  234. /**
  235. * Generate a form for editing items in this list.
  236. *
  237. * @return object saf.MailForm object
  238. */
  239. function &getEditForm ($item) {
  240. loader_import ('saf.MailForm');
  241. $form = new MailForm;
  242. $form->action = site_prefix () . '/index/usradm-edit-user-action';
  243. $form->error_mode = 'all';
  244. loader_import ('ext.phpsniff');
  245. $sniffer = new phpSniff;
  246. $form->_browser = $sniffer->property ('browser');
  247. $user = session_user_get ($item);
  248. $form->addWidget ('hidden', '_list');
  249. page_add_script ('
  250. formhelp_prepend = \'<table border="0" cellpadding="0"><tr><td width="12" valign="top"><img src="' . site_prefix () . '/inc/app/cms/pix/arrow-10px.gif" alt="" border="0" /></td><td valign="top">\';
  251. formhelp_append = \'</td></tr></table>\';
  252. ');
  253. $w =& $form->addWidget ('tab', 'tab1');
  254. $w->title = intl_get ('Account');
  255. $w =& $form->addWidget ('info', '_key');
  256. $w->alt = intl_get ('Username');
  257. $w->extra = 'maxlength="48"';
  258. $w =& $form->addWidget ('password', 'passwd');
  259. $w->alt = intl_get ('Password');
  260. $w =& $form->addWidget ('password', 'password_verify');
  261. $w->alt = intl_get ('Verify Password');
  262. $w->addRule ('equals "passwd"', intl_get ('Passwords do not match.'));
  263. $w->ignoreEmpty = false;
  264. $w =& $form->addWidget ('text', 'firstname');
  265. $w->alt = intl_get ('First Name');
  266. //$w->addRule ('not empty', intl_get ('First name must not be empty.'));
  267. $w->setValue ($user->firstname);
  268. $w->extra = 'maxlength="32"';
  269. $w =& $form->addWidget ('text', 'lastname');
  270. $w->alt = intl_get ('Last Name');
  271. //$w->addRule ('not empty', intl_get ('Last name must not be empty.'));
  272. $w->setValue ($user->lastname);
  273. $w->extra = 'maxlength="32"';
  274. $w =& $form->addWidget ('text', 'email');
  275. $w->alt = intl_get ('Email');
  276. //$w->addRule ('not empty', intl_get ('Email must not be empty.'));
  277. //$w->addRule ('contains "@"', intl_get ('Email does not appear to be valid.'));
  278. $w->setValue ($user->email);
  279. $w->extra = 'maxlength="42"';
  280. $snm =& session_get_manager ();
  281. $list = assocify (array_keys ($snm->role->getList ()));
  282. unset ($list['anonymous']);
  283. unset ($list['']);
  284. $w =& $form->addWidget ('select', 'role');
  285. $w->alt = intl_get ('Role');
  286. $w->setValues ($list);
  287. $w->setValue ($user->role);
  288. $w->extra = 'id="role"';
  289. $w =& $form->addWidget ('select', 'team');
  290. $w->alt = intl_get ('Team');
  291. $w->setValues (assocify (array_keys ($snm->team->getList ())));
  292. $w->setValue ($user->team);
  293. $w->extra = 'id="team"';
  294. $w =& $form->addWidget ('select', 'disabled');
  295. $w->alt = intl_get ('Disabled');
  296. $w->setValues (array ('yes' => 'Yes', 'no' => 'No'));
  297. $w->setValue ($user->disabled);
  298. $w->extra = 'id="disabled"';
  299. $w =& $form->addWidget ('select', 'public');
  300. $w->alt = intl_get ('Public');
  301. $w->setValues (array ('yes' => 'Yes', 'no' => 'No'));
  302. $w->setValue ($user->public);
  303. $w->extra = 'id="public"';
  304. $w =& $form->addWidget ('textarea', 'profile');
  305. $w->alt = intl_get ('Profile');
  306. $w->setValue ($user->profile);
  307. $w->labelPosition = 'left';
  308. $w->rows = 5;
  309. $w->extra = 'id="profile"';
  310. $w =& $form->addWidget ('textarea', 'sig');
  311. $w->alt = intl_get ('Signature (for comments)');
  312. $w->setValue ($user->sig);
  313. $w->labelPosition = 'left';
  314. $w->rows = 3;
  315. $w->extra = 'id="sig"';
  316. $w =& $form->addWidget ('info', 'registered');
  317. $w->alt = intl_get ('Date Registered');
  318. $w->setValue (loader_call ('saf.Date', 'Date::timestamp', $user->registered, 'F jS, Y - g:i A'));
  319. $w =& $form->addWidget ('info', 'modified');
  320. $w->alt = intl_get ('Date Last Modified');
  321. $w->setValue (loader_call ('saf.Date', 'Date::timestamp', $user->modified, 'F jS, Y - g:i A'));
  322. $w =& $form->addWidget ('tab', 'tab2');
  323. $w->title = intl_get ('Contact');
  324. $w =& $form->addWidget ('text', 'company');
  325. $w->alt = intl_get ('Company');
  326. $w->setValue ($user->company);
  327. $w->extra = 'maxlength="48"';
  328. $w =& $form->addWidget ('text', 'position');
  329. $w->alt = intl_get ('Position');
  330. $w->setValue ($user->position);
  331. $w->extra = 'maxlength="48"';
  332. $w =& $form->addWidget ('text', 'website');
  333. $w->alt = intl_get ('Web Site');
  334. if (! empty ($user->website)) {
  335. $w->setValue ($user->website);
  336. } else {
  337. $w->setValue ('http://');
  338. }
  339. $w->extra = 'maxlength="72"';
  340. $w =& $form->addWidget ('text', 'phone');
  341. $w->alt = intl_get ('Phone #');
  342. $w->setValue ($user->phone);
  343. $w->extra = 'maxlength="24"';
  344. $w =& $form->addWidget ('text', 'cell');
  345. $w->alt = intl_get ('Cell #');
  346. $w->setValue ($user->cell);
  347. $w->extra = 'maxlength="24"';
  348. $w =& $form->addWidget ('text', 'fax');
  349. $w->alt = intl_get ('Fax #');
  350. $w->setValue ($user->fax);
  351. $w->extra = 'maxlength="24"';
  352. $w =& $form->addWidget ('text', 'sms_address');
  353. $w->alt = intl_get ('SMS #');
  354. $w->setValue ($user->sms_address);
  355. $w->extra = 'maxlength="72"';
  356. $w =& $form->addWidget ('text', 'jabber_id');
  357. $w->alt = intl_get ('Jabber ID');
  358. $w->setValue ($user->jabber_id);
  359. $w->extra = 'maxlength="48"';
  360. $w =& $form->addWidget ('text', 'address1');
  361. $w->alt = intl_get ('Address');
  362. $w->setValue ($user->address1);
  363. $w->extra = 'maxlength="72"';
  364. $w =& $form->addWidget ('text', 'address2');
  365. $w->alt = intl_get ('Address Line 2');
  366. $w->setValue ($user->address2);
  367. $w->extra = 'maxlength="72"';
  368. $w =& $form->addWidget ('text', 'city');
  369. $w->alt = intl_get ('City');
  370. $w->setValue ($user->city);
  371. $w->extra = 'maxlength="48"';
  372. $w =& $form->addWidget ('text', 'province');
  373. $w->alt = intl_get ('Province/State');
  374. $w->setValue ($user->province);
  375. $w->extra = 'maxlength="48"';
  376. $w =& $form->addWidget ('text', 'postal_code');
  377. $w->alt = intl_get ('Postal/Zip Code');
  378. $w->setValue ($user->postal_code);
  379. $w->extra = 'maxlength="16"';
  380. $w =& $form->addWidget ('text', 'country');
  381. $w->alt = intl_get ('Country');
  382. $w->setValue ($user->country);
  383. $w->extra = 'maxlength="48"';
  384. $w =& $form->addWidget ('tab', 'tab3');
  385. $w->title = intl_get ('Access');
  386. $w =& $form->addWidget ('usradm.Widget.Allowedbox', 'teams');
  387. $w->alt = 'Allowed Teams';
  388. $w->headers[] = '&nbsp;';
  389. $w->headers[] = intl_get ('Read');
  390. $w->headers[] = intl_get ('Write');
  391. $b =& $w->addButton ('all', array ('r' => '', 'w' => ''));
  392. $b->alt = '<strong>All</strong>';
  393. $teams = unserialize ($user->teams);
  394. if (isset ($teams['all'])) {
  395. $b->setValue (assocify (preg_split ('//', $teams['all'], -1, PREG_SPLIT_NO_EMPTY)));
  396. }
  397. foreach (session_get_teams () as $value) {
  398. $b =& $w->addButton ($value, array ('r' => '', 'w' => ''));
  399. $b->alt = ucwords (str_replace ('_', ' ', $value));
  400. $b->setValue (assocify (preg_split ('//', $teams[$value], -1, PREG_SPLIT_NO_EMPTY)));
  401. }
  402. $w =& $form->addWidget ('tab', 'tab-end');
  403. $w =& $form->addWidget ('msubmit', 'submit_button');
  404. $b =& $w->getButton ();
  405. $b->setValues (intl_get ('Save'));
  406. $b =& $w->addButton ('cancel_button');
  407. $b->setValues (intl_get ('Cancel'));
  408. $b->extra = 'onclick="window.location.href = \'' . site_prefix () . '/index/usradm-browse-action?list=users\'; return false"';
  409. return $form;
  410. }
  411. }
  412. /**
  413. * @package Session
  414. */
  415. class SessionManager_Role { // Lives in inc/conf/auth/roles/${name}.php
  416. /* INI Format:
  417. * [role]
  418. * name = master
  419. * admin = yes
  420. * disabled = no
  421. * [allow:resources]
  422. * all = rw
  423. * [allow:access]
  424. * all = rw
  425. * [allow:status]
  426. * all = rw
  427. */
  428. /**
  429. * Directory to store info.
  430. */
  431. var $dir = 'inc/conf/auth/roles';
  432. /**
  433. * Parsed data from file.
  434. */
  435. var $data = array ();
  436. /**
  437. * Error message, if an error occurs.
  438. */
  439. var $error;
  440. /**
  441. * Constructor method.
  442. */
  443. function SessionManager_Role () {
  444. loader_import ('saf.File.Directory');
  445. $this->getData ();
  446. }
  447. /**
  448. * Retrieves the data from and stores it in $data.
  449. */
  450. function getData () {
  451. foreach (Dir::find ('*.php', $this->dir, false) as $file) {
  452. if (strpos ($file, '.') === 0) {
  453. continue;
  454. }
  455. $inidata = ini_parse ($file, true);
  456. $this->data[$inidata['role']['name']] = $inidata;
  457. }
  458. }
  459. /**
  460. * Returns an array of the data.
  461. *
  462. * @return array
  463. */
  464. function getList () {
  465. return $this->data;
  466. }
  467. /**
  468. * Adds an item to $data and rewrites the INI file.
  469. *
  470. * @param string
  471. * @param boolean
  472. * @return boolean
  473. */
  474. function add ($name, $data) {
  475. if (strstr ($name, '..')) {
  476. $this->error = 'Invalid role name!';
  477. return false;
  478. }
  479. $this->data[$name] = $data;
  480. $r = file_overwrite ($this->dir . '/' . $name . '.php', ini_write ($this->data[$name]));
  481. if (! $r) {
  482. $this->error = 'Failed to write INI file!';
  483. }
  484. return $r;
  485. }
  486. /**
  487. * Renames an item in $data and rewrites the INI file.
  488. *
  489. * @param string
  490. * @param string
  491. * @param array hash
  492. * @return boolean
  493. */
  494. function edit ($name, $newname, $data) {
  495. if (strstr ($name, '..')) {
  496. $this->error = 'Invalid role name!';
  497. return false;
  498. }
  499. if (strstr ($newname, '..')) {
  500. $this->error = 'Invalid role name!';
  501. return false;
  502. }
  503. unset ($this->data[$name]);
  504. $r = unlink ($this->dir . '/' . $name . '.php');
  505. if (! $r) {
  506. $this->error = 'Failed to remove INI file!';
  507. }
  508. $this->data[$newname] = $data;
  509. $r = file_overwrite ($this->dir . '/' . $newname . '.php', ini_write ($this->data[$newname]));
  510. if (! $r) {
  511. $this->error = 'Failed to write INI file!';
  512. }
  513. return $r;
  514. }
  515. /**
  516. * Deletes an item from $data and rewrites the INI file.
  517. *
  518. * @param string
  519. * @return boolean
  520. */
  521. function delete ($name) {
  522. if (strstr ($name, '..')) {
  523. $this->error = 'Invalid role name!';
  524. return false;
  525. }
  526. unset ($this->data[$name]);
  527. $r = unlink ($this->dir . '/' . $name . '.php');
  528. if (! $r) {
  529. $this->error = 'Failed to remove INI file!';
  530. }
  531. return $r;
  532. }
  533. /**
  534. * Generate a form for adding items to this list.
  535. *
  536. * @return object saf.MailForm object
  537. */
  538. function &getAddForm () {
  539. loader_import ('saf.MailForm');
  540. $form = new MailForm;
  541. $form->action = site_prefix () . '/index/usradm-add-role-action';
  542. $form->error_mode = 'all';
  543. $form->addWidget ('hidden', '_list');
  544. $w =& $form->addWidget ('tab', 'tab1');
  545. $w->title = intl_get ('Edit');
  546. $w =& $form->addWidget ('text', 'name');
  547. $w->alt = intl_get ('Name');
  548. $w->addRule ('not empty', intl_get ('Role name must not be empty.'));
  549. $w->extra = 'maxlength="32"';
  550. $w =& $form->addWidget ('select', 'admin');
  551. $w->alt = intl_get ('Is admin?');
  552. $w->setValues (array ('yes' => 'Yes', 'no' => 'No'));
  553. $w->setValue ('no');
  554. $w->extra = 'id="admin"';
  555. $w =& $form->addWidget ('select', 'disabled');
  556. $w->alt = intl_get ('Disabled');
  557. $w->setValues (array ('yes' => 'Yes', 'no' => 'No'));
  558. $w->setValue ('no');
  559. $w->extra = 'id="disabled"';
  560. $w =& $form->addWidget ('tab', 'tab2');
  561. $w->title = intl_get ('Resources');
  562. $w =& $form->addWidget ('usradm.Widget.Allowedbox', 'resources');
  563. $w->alt = 'Allowed Resources';
  564. $w->headers[] = '&nbsp;';
  565. $w->headers[] = intl_get ('Read');
  566. $w->headers[] = intl_get ('Write');
  567. $b =& $w->addButton ('all', array ('r' => '', 'w' => ''));
  568. $b->alt = '<strong>All</strong>';
  569. loader_import ('usradm.Functions');
  570. $resources = array ();
  571. foreach (session_get_resources () as $value) {
  572. $resources[$value] = usradm_resource_name ($value);
  573. }
  574. asort ($resources);
  575. foreach ($resources as $key => $value) {
  576. $b =& $w->addButton ($key, array ('r' => '', 'w' => ''));
  577. $b->alt = $value;
  578. }
  579. $w =& $form->addWidget ('tab', 'tab3');
  580. $w->title = intl_get ('Access Levels');
  581. $w =& $form->addWidget ('usradm.Widget.Allowedbox', 'accesslevels');
  582. $w->alt = 'Allowed Access Levels';
  583. $w->headers[] = '&nbsp;';
  584. $w->headers[] = intl_get ('Read');
  585. $w->headers[] = intl_get ('Write');
  586. $b =& $w->addButton ('all', array ('r' => '', 'w' => ''));
  587. $b->alt = '<strong>All</strong>';
  588. foreach (session_get_access_levels () as $value) {
  589. $b =& $w->addButton ($value, array ('r' => '', 'w' => ''));
  590. $b->alt = ucwords (str_replace ('_', ' ', $value));
  591. }
  592. $w =& $form->addWidget ('tab', 'tab4');
  593. $w->title = intl_get ('Statuses');
  594. $w =& $form->addWidget ('usradm.Widget.Allowedbox', 'statuses');
  595. $w->alt = 'Allowed Statuses';
  596. $w->headers[] = '&nbsp;';
  597. $w->headers[] = intl_get ('Read');
  598. $w->headers[] = intl_get ('Write');
  599. $b =& $w->addButton ('all', array ('r' => '', 'w' => ''));
  600. $b->alt = '<strong>All</strong>';
  601. foreach (session_get_statuses () as $value) {
  602. $b =& $w->addButton ($value, array ('r' => '', 'w' => ''));
  603. $b->alt = ucwords (str_replace ('_', ' ', $value));
  604. }
  605. $w =& $form->addWidget ('tab', 'tab-end');
  606. $w =& $form->addWidget ('msubmit', 'submit_button');
  607. $b =& $w->getButton ();
  608. $b->setValues (intl_get ('Save'));
  609. $b =& $w->addButton ('cancel_button');
  610. $b->setValues (intl_get ('Cancel'));
  611. $b->extra = 'onclick="window.location.href = \'' . site_prefix () . '/index/usradm-browse-action?list=roles\'; return false"';
  612. return $form;
  613. }
  614. /**
  615. * Generate a form for editing items in this list.
  616. *
  617. * @return object saf.MailForm object
  618. */
  619. function &getEditForm ($item) {
  620. loader_import ('saf.MailForm');
  621. $form = new MailForm;
  622. $form->action = site_prefix () . '/index/usradm-edit-role-action';
  623. $form->error_mode = 'all';
  624. $form->addWidget ('hidden', '_list');
  625. $form->addWidget ('hidden', '_key');
  626. $w =& $form->addWidget ('tab', 'tab1');
  627. $w->title = intl_get ('Edit');
  628. $w =& $form->addWidget ('text', 'name');
  629. $w->alt = intl_get ('Name');
  630. $w->addRule ('not empty', intl_get ('Role name must not be empty.'));
  631. $w->setValue ($item);
  632. $w->extra = 'maxlength="32"';
  633. $w =& $form->addWidget ('select', 'admin');
  634. $w->alt = intl_get ('Is admin?');
  635. $w->setValues (array ('yes' => 'Yes', 'no' => 'No'));
  636. if ($this->data[$item]['role']['admin']) {
  637. $w->setValue ('yes');
  638. } else {
  639. $w->setValue ('no');
  640. }
  641. $w->extra = 'id="admin"';
  642. $w =& $form->addWidget ('select', 'disabled');
  643. $w->alt = intl_get ('Disabled');
  644. $w->setValues (array ('yes' => 'Yes', 'no' => 'No'));
  645. $w->setValue ('no');
  646. if ($this->data[$item]['role']['disabled']) {
  647. $w->setValue ('yes');
  648. } else {
  649. $w->setValue ('no');
  650. }
  651. $w->extra = 'id="disabled"';
  652. $w =& $form->addWidget ('tab', 'tab2');
  653. $w->title = intl_get ('Resources');
  654. $w =& $form->addWidget ('usradm.Widget.Allowedbox', 'resources');
  655. $w->alt = 'Allowed Resources';
  656. $w->headers[] = '&nbsp;';
  657. $w->headers[] = intl_get ('Read');
  658. $w->headers[] = intl_get ('Write');
  659. $b =& $w->addButton ('all', array ('r' => '', 'w' => ''));
  660. $b->alt = '<strong>All</strong>';
  661. $b->setValue (assocify (preg_split ('//', $this->data[$item]['allow:resources']['all'], -1, PREG_SPLIT_NO_EMPTY)));
  662. loader_import ('usradm.Functions');
  663. $resources = array ();
  664. foreach (session_get_resources () as $value) {
  665. $resources[$value] = usradm_resource_name ($value);
  666. }
  667. asort ($resources);
  668. foreach ($resources as $key => $value) {
  669. $b =& $w->addButton ($key, array ('r' => '', 'w' => ''));
  670. $b->alt = $value;
  671. $b->setValue (assocify (preg_split ('//', $this->data[$item]['allow:resources'][$key], -1, PREG_SPLIT_NO_EMPTY)));
  672. }
  673. //foreach (session_get_resources () as $value) {
  674. // $b =& $w->addButton ($value, array ('r' => '', 'w' => ''));
  675. // $b->alt = ucwords (str_replace ('_', ' ', $value));
  676. // $b->setValue (assocify (preg_split ('//', $this->data[$item]['allow:resources'][$value], -1, PREG_SPLIT_NO_EMPTY)));
  677. //}
  678. $w =& $form->addWidget ('tab', 'tab3');
  679. $w->title = intl_get ('Access Levels');
  680. $w =& $form->addWidget ('usradm.Widget.Allowedbox', 'accesslevels');
  681. $w->alt = 'Allowed Access Levels';
  682. $w->headers[] = '&nbsp;';
  683. $w->headers[] = intl_get ('Read');
  684. $w->headers[] = intl_get ('Write');
  685. $b =& $w->addButton ('all', array ('r' => '', 'w' => ''));
  686. $b->alt = '<strong>All</strong>';
  687. $b->setValue (assocify (preg_split ('//', $this->data[$item]['allow:access']['all'], -1, PREG_SPLIT_NO_EMPTY)));
  688. foreach (session_get_access_levels () as $value) {
  689. $b =& $w->addButton ($value, array ('r' => '', 'w' => ''));
  690. $b->alt = ucwords (str_replace ('_', ' ', $value));
  691. $b->setValue (assocify (preg_split ('//', $this->data[$item]['allow:access'][$value], -1, PREG_SPLIT_NO_EMPTY)));
  692. }
  693. $w =& $form->addWidget ('tab', 'tab4');
  694. $w->title = intl_get ('Statuses');
  695. $w =& $form->addWidget ('usradm.Widget.Allowedbox', 'statuses');
  696. $w->alt = 'Allowed Statuses';
  697. $w->headers[] = '&nbsp;';
  698. $w->headers[] = intl_get ('Read');
  699. $w->headers[] = intl_get ('Write');
  700. $b =& $w->addButton ('all', array ('r' => '', 'w' => ''));
  701. $b->alt = '<strong>All</strong>';
  702. $b->setValue (assocify (preg_split ('//', $this->data[$item]['allow:status']['all'], -1, PREG_SPLIT_NO_EMPTY)));
  703. foreach (session_get_statuses () as $value) {
  704. $b =& $w->addButton ($value, array ('r' => '', 'w' => ''));
  705. $b->alt = ucwords (str_replace ('_', ' ', $value));
  706. $b->setValue (assocify (preg_split ('//', $this->data[$item]['allow:status'][$value], -1, PREG_SPLIT_NO_EMPTY)));
  707. }
  708. $w =& $form->addWidget ('tab', 'tab-end');
  709. $w =& $form->addWidget ('msubmit', 'submit_button');
  710. $b =& $w->getButton ();
  711. $b->setValues (intl_get ('Save'));
  712. $b =& $w->addButton ('cancel_button');
  713. $b->setValues (intl_get ('Cancel'));
  714. $b->extra = 'onclick="window.location.href = \'' . site_prefix () . '/index/usradm-browse-action?list=roles\'; return false"';
  715. return $form;
  716. }
  717. }
  718. /**
  719. * @package Session
  720. */
  721. class SessionManager_Pref { // Lives in inc/conf/auth/prefs/index.php
  722. /* INI Format:
  723. * [pref_name]
  724. * alt = Display Name
  725. * instructions = Instructions for site admins
  726. * type = mailform type
  727. * value 1 = first value
  728. * value 2 = second value
  729. * default_value = first value
  730. */
  731. /**
  732. * File to store info.
  733. */
  734. var $file = 'inc/conf/auth/preferences/index.php';
  735. /**
  736. * Parsed data from file.
  737. */
  738. var $data = array ();
  739. /**
  740. * Error message, if an error occurs.
  741. */
  742. var $error;
  743. /**
  744. * Constructor method.
  745. */
  746. function SessionManager_Pref () {
  747. $this->getData ();
  748. }
  749. /**
  750. * Retrieves the data from $file and stores it in $data.
  751. */
  752. function getData () {
  753. $this->data = ini_parse ($this->file, true);
  754. }
  755. /**
  756. * Returns an array of the data.
  757. *
  758. * @return array
  759. */
  760. function getList () {
  761. return $this->data;
  762. }
  763. /**
  764. * Adds an item to $data and rewrites the INI file.
  765. *
  766. * @param string
  767. * @param boolean
  768. * @return boolean
  769. */
  770. function add ($name, $data) {
  771. $this->data[$name] = $data;
  772. $r = file_overwrite ($this->file, ini_write ($this->data));
  773. if (! $r) {
  774. $this->error = 'Failed to write INI file!';
  775. }
  776. return $r;
  777. }
  778. /**
  779. * Renames an item in $data and rewrites the INI file.
  780. *
  781. * @param string
  782. * @param string
  783. * @param array hash
  784. * @return boolean
  785. */
  786. function edit ($name, $newname, $data) {
  787. unset ($this->data[$name]);
  788. $this->data[$newname] = $data;
  789. $r = file_overwrite ($this->file, ini_write ($this->data));
  790. if (! $r) {
  791. $this->error = 'Failed to write INI file!';
  792. }
  793. return $r;
  794. }
  795. /**
  796. * Deletes an item from $data and rewrites the INI file.
  797. *
  798. * @param string
  799. * @return boolean
  800. */
  801. function delete ($name) {
  802. unset ($this->data[$name]);
  803. $r = file_overwrite ($this->file, ini_write ($this->data));
  804. if (! $r) {
  805. $this->error = 'Failed to write INI file!';
  806. }
  807. return $r;
  808. }
  809. /*
  810. * Show as form fields:
  811. * pref_name => text
  812. * alt => text
  813. * type => always 'select' (don't show)
  814. * value n => textarea (one-per-line)
  815. * values => text (in lieu of "value n" enter a function name that returns a value array)
  816. * default_value => text
  817. */
  818. /**
  819. * Generate a form for adding items to this list.
  820. *
  821. * @return object saf.MailForm object
  822. */
  823. function &getAddForm () {
  824. loader_import ('saf.MailForm');
  825. $form = new MailForm;
  826. $form->action = site_prefix () . '/index/usradm-add-pref-action';
  827. $form->error_mode = 'all';
  828. $form->addWidget ('hidden', '_list');
  829. $w =& $form->addWidget ('text', 'pref_name');
  830. $w->alt = intl_get ('Preference Name');
  831. $w->addRule ('not empty', intl_get ('Preference name may not be empty.'));
  832. $w->extra = 'maxlength="32"';
  833. $w =& $form->addWidget ('text', 'alt');
  834. $w->alt = intl_get ('Display Name');
  835. $w->addRule ('not empty', intl_get ('Display name may not be empty.'));
  836. $w =& $form->addWidget ('text', 'instructions');
  837. $w->alt = intl_get ('Instructions');
  838. $w->addRule ('not empty', intl_get ('Instructions may not be empty.'));
  839. $w->extra = 'size="40"';
  840. $w =& $form->addWidget ('textarea', 'value_list');
  841. $w->alt = intl_get ('Values (one-per-line)');
  842. $w->rows = 3;
  843. $w->labelPosition = 'left';
  844. $w =& $form->addWidget ('text', 'values');
  845. $w->alt = intl_get ('Retrieve values from function');
  846. $w =& $form->addWidget ('text', 'default_value');
  847. $w->alt = intl_get ('Default Value');
  848. $w =& $form->addWidget ('msubmit', 'submit_button');
  849. $b =& $w->getButton ();
  850. $b->setValues (intl_get ('Save'));
  851. $b =& $w->addButton ('cancel_button');
  852. $b->setValues (intl_get ('Cancel'));
  853. $b->extra = 'onclick="window.location.href = \'' . site_prefix () . '/index/usradm-browse-action?list=prefs\'; return false"';
  854. return $form;
  855. }
  856. /**
  857. * Generate a form for editing items in this list.
  858. *
  859. * @return object saf.MailForm object
  860. */
  861. function &getEditForm ($item) {
  862. loader_import ('saf.MailForm');
  863. $form = new MailForm;
  864. $form->action = site_prefix () . '/index/usradm-edit-pref-action';
  865. $form->error_mode = 'all';
  866. $form->addWidget ('hidden', '_list');
  867. $form->addWidget ('hidden', '_key');
  868. $w =& $form->addWidget ('text', 'pref_name');
  869. $w->alt = intl_get ('Preference Name');
  870. $w->addRule ('not empty', intl_get ('Preference name may not be empty.'));
  871. $w->setValue ($item);
  872. $w->extra = 'maxlength="32"';
  873. $w =& $form->addWidget ('text', 'alt');
  874. $w->alt = intl_get ('Display Name');
  875. $w->addRule ('not empty', intl_get ('Display name may not be empty.'));
  876. $w->setValue ($this->data[$item]['alt']);
  877. $w =& $form->addWidget ('text', 'instructions');
  878. $w->alt = intl_get ('Instructions');
  879. $w->addRule ('not empty', intl_get ('Instructions may not be empty.'));
  880. $w->extra = 'size="40"';
  881. $w->setValue ($this->data[$item]['instructions']);
  882. $w =& $form->addWidget ('textarea', 'value_list');
  883. $w->alt = intl_get ('Values (one-per-line)');
  884. $w->rows = 3;
  885. $w->labelPosition = 'left';
  886. $vals = '';
  887. foreach ($this->data[$item] as $k => $v) {
  888. if (strpos ($k, 'value ') === 0) {
  889. if ($v === '1') {
  890. $vals .= 'on' . NEWLINE;
  891. } elseif (! $v) {
  892. $vals .= 'off' . NEWLINE;
  893. } else {
  894. $vals .= $v . NEWLINE;
  895. }
  896. }
  897. }
  898. $w->setValue ($vals);
  899. $w =& $form->addWidget ('text', 'values');
  900. $w->alt = intl_get ('Retrieve values from function');
  901. $w->setValue ($this->data[$item]['values']);
  902. $w =& $form->addWidget ('text', 'default_value');
  903. $w->alt = intl_get ('Default Value');
  904. $v = $this->data[$item]['default_value'];
  905. if ($v === '1') {
  906. $w->setValue ('on');
  907. } else {
  908. $w->setValue ($v);
  909. }
  910. $w =& $form->addWidget ('msubmit', 'submit_button');
  911. $b =& $w->getButton ();
  912. $b->setValues (intl_get ('Save'));
  913. $b =& $w->addButton ('cancel_button');
  914. $b->setValues (intl_get ('Cancel'));
  915. $b->extra = 'onclick="window.location.href = \'' . site_prefix () . '/index/usradm-browse-action?list=prefs\'; return false"';
  916. return $form;
  917. }
  918. }
  919. /**
  920. * @package Session
  921. */
  922. class SessionManager_Team { // Lives in inc/conf/auth/teams/index.php
  923. /* INI Format:
  924. * [core]
  925. * disaabled = no
  926. * description = "This is the default team."
  927. */
  928. /**
  929. * File to store info.
  930. */
  931. var $file = 'inc/conf/auth/teams/index.php';
  932. /**
  933. * Parsed data from file.
  934. */
  935. var $data = array ();
  936. /**
  937. * Error message, if an error occurs.
  938. */
  939. var $error;
  940. /**
  941. * Constructor method.
  942. */
  943. function SessionManager_Team () {
  944. $this->getData ();
  945. }
  946. /**
  947. * Retrieves the data from $file and stores it in $data.
  948. */
  949. function getData () {
  950. $this->data = ini_parse ($this->file, true);
  951. }
  952. /**
  953. * Returns an array of the data.
  954. *
  955. * @return array
  956. */
  957. function getList () {
  958. return $this->data;
  959. }
  960. /**
  961. * Adds an item to $data and rewrites the INI file.
  962. *
  963. * @param string
  964. * @param boolean
  965. * @param string
  966. * @return boolean
  967. */
  968. function add ($name, $disabled, $description) {
  969. $this->data[$name] = array ('disabled' => $disabled, 'description' => $description);
  970. $r = file_overwrite ($this->file, ini_write ($this->data));
  971. if (! $r) {
  972. $this->error = 'Failed to write INI file!';
  973. }
  974. return $r;
  975. }
  976. /**
  977. * Renames an item in $data and rewrites the INI file.
  978. *
  979. * @param string
  980. * @param string
  981. * @param boolean
  982. * @param string
  983. * @return boolean
  984. */
  985. function edit ($name, $newname, $disabled, $description) {
  986. unset ($this->data[$name]);
  987. $this->data[$newname] = array ('disabled' => $disabled, 'description' => $description);
  988. $r = file_overwrite ($this->file, ini_write ($this->data));
  989. if (! $r) {
  990. $this->error = 'Failed to write INI file!';
  991. }
  992. return $r;
  993. }
  994. /**
  995. * Deletes an item from $data and rewrites the INI file.
  996. *
  997. * @param string
  998. * @return boolean
  999. */
  1000. function delete ($name) {
  1001. unset ($this->data[$name]);
  1002. $r = file_overwrite ($this->file, ini_write ($this->data));
  1003. if (! $r) {
  1004. $this->error = 'Failed to write INI file!';
  1005. }
  1006. return $r;
  1007. }
  1008. /**
  1009. * Generate a form for adding items to this list.
  1010. *
  1011. * @return object saf.MailForm object
  1012. */
  1013. function &getAddForm () {
  1014. loader_import ('saf.MailForm');
  1015. $form = new MailForm;
  1016. $form->action = site_prefix () . '/index/usradm-add-team-action';
  1017. $form->error_mode = 'all';
  1018. $form->addWidget ('hidden', '_list');
  1019. $w =& $form->addWidget ('text', 'name');
  1020. $w->alt = intl_get ('Name');
  1021. $w->addRule ('not empty', intl_get ('Team name may not be empty.'));
  1022. $w->extra = 'maxlength="48"';
  1023. $w =& $form->addWidget ('select', 'disabled');
  1024. $w->alt = intl_get ('Disabled');
  1025. $w->setValues (array ('yes' => intl_get ('Yes'), 'no' => intl_get ('No')));
  1026. $w->setValue ('no');
  1027. $w =& $form->addWidget ('text', 'description');
  1028. $w->alt = intl_get ('Description');
  1029. $w->addRule ('not empty', intl_get ('Description may not be empty.'));
  1030. $w->extra = 'size="40"';
  1031. $w =& $form->addWidget ('msubmit', 'submit_button');
  1032. $b =& $w->getButton ();
  1033. $b->setValues (intl_get ('Save'));
  1034. $b =& $w->addButton ('cancel_button');
  1035. $b->setValues (intl_get ('Cancel'));
  1036. $b->extra = 'onclick="window.location.href = \'' . site_prefix () . '/index/usradm-browse-action?list=teams\'; return false"';
  1037. return $form;
  1038. }
  1039. /**
  1040. * Generate a form for editing items in this list.
  1041. *
  1042. * @return object saf.MailForm object
  1043. */
  1044. function &getEditForm ($item) {
  1045. loader_import ('saf.MailForm');
  1046. $form = new MailForm;
  1047. $form->action = site_prefix () . '/index/usradm-edit-team-action';
  1048. $form->error_mode = 'all';
  1049. $form->addWidget ('hidden', '_list');
  1050. $form->addWidget ('hidden', '_key');
  1051. $w =& $form->addWidget ('info', 'name');
  1052. $w->alt = intl_get ('Name');
  1053. $w->addRule ('not empty', intl_get ('Team name may not be empty.'));
  1054. $w->setValue ($item);
  1055. $w->extra = 'maxlength="48"';
  1056. $w =& $form->addWidget ('select', 'disabled');
  1057. $w->alt = intl_get ('Disabled');
  1058. $w->setValues (array ('yes' => intl_get ('Yes'), 'no' => intl_get ('No')));
  1059. if (! $this->data[$item]['disabled']) {
  1060. $w->setValue ('no');
  1061. } else {
  1062. $w->setValue ('yes');
  1063. }
  1064. $w =& $form->addWidget ('text', 'description');
  1065. $w->alt = intl_get ('Description');
  1066. $w->addRule ('not empty', intl_get ('Description may not be empty.'));
  1067. $w->extra = 'size="40"';
  1068. $w->setValue ($this->data[$item]['description']);
  1069. $w =& $form->addWidget ('msubmit', 'submit_button');
  1070. $b =& $w->getButton ();
  1071. $b->setValues (intl_get ('Save'));
  1072. $b =& $w->addButton ('cancel_button');
  1073. $b->setValues (intl_get ('Cancel'));
  1074. $b->extra = 'onclick="window.location.href = \'' . site_prefix () . '/index/usradm-browse-action?list=teams\'; return false"';
  1075. return $form;
  1076. }
  1077. }
  1078. /**
  1079. * Handles INI files of the format:
  1080. *
  1081. * value1=
  1082. * value2=
  1083. * value3=
  1084. *
  1085. * @package Session
  1086. */
  1087. class SessionManager_Simple {
  1088. /**
  1089. * File to store info.
  1090. */
  1091. var $file;
  1092. /**
  1093. * Parsed data from file.
  1094. */
  1095. var $data = array ();
  1096. /**
  1097. * Error message, if an error occurs.
  1098. */
  1099. var $error;
  1100. /**
  1101. * Constructor method.
  1102. */
  1103. function SessionManager_Simple () {
  1104. $this->getData ();
  1105. }
  1106. /**
  1107. * Retrieves the data from $file and stores it in $data.
  1108. */
  1109. function getData () {
  1110. $this->data = ini_parse ($this->file, false);
  1111. }
  1112. /**
  1113. * Returns an array of the data.
  1114. *
  1115. * @return array
  1116. */
  1117. function getList () {
  1118. return array_keys ($this->data);
  1119. }
  1120. /**
  1121. * Adds an item to $data and rewrites the INI file.
  1122. *
  1123. * @param string
  1124. * @return boolean
  1125. */
  1126. function add ($name) {
  1127. $this->data[$name] = '';
  1128. $r = file_overwrite ($this->file, ini_write ($this->data));
  1129. if (! $r) {
  1130. $this->error = 'Failed to write INI file!';
  1131. }
  1132. return $r;
  1133. }
  1134. /**
  1135. * Renames an item in $data and rewrites the INI file.
  1136. *
  1137. * @param string
  1138. * @param string
  1139. * @return boolean
  1140. */
  1141. function edit ($name, $newname) {
  1142. unset ($this->data[$name]);
  1143. $this->data[$newname] = '';
  1144. $r = file_overwrite ($this->file, ini_write ($this->data));
  1145. if (! $r) {
  1146. $this->error = 'Failed to write INI file!';
  1147. }
  1148. return $r;
  1149. }
  1150. /**
  1151. * Deletes an item from $data and rewrites the INI file.
  1152. *
  1153. * @param string
  1154. * @return boolean
  1155. */
  1156. function delete ($name) {
  1157. unset ($this->data[$name]);
  1158. $r = file_overwrite ($this->file, ini_write ($this->data));
  1159. if (! $r) {
  1160. $this->error = 'Failed to write INI file!';
  1161. }
  1162. return $r;
  1163. }
  1164. }
  1165. /**
  1166. * @package Session
  1167. */
  1168. class SessionManager_Status extends SessionManager_Simple { // Lives in inc/conf/auth/status/index.php
  1169. /* INI Format:
  1170. * approved=
  1171. */
  1172. /**
  1173. * File to store status info.
  1174. */
  1175. var $file = 'inc/conf/auth/status/index.php';
  1176. }
  1177. /**
  1178. * @package Session
  1179. */
  1180. class SessionManager_Access extends SessionManager_Simple { // Lives in inc/conf/auth/access/index.php
  1181. /* INI Format:
  1182. * public=
  1183. */
  1184. /**
  1185. * File to store access info.
  1186. */
  1187. var $file = 'inc/conf/auth/access/index.php';
  1188. }
  1189. /**
  1190. * @package Session
  1191. */
  1192. class SessionManager_Resource extends SessionManager_Simple { // Lives in inc/conf/auth/resources/index.php
  1193. /* INI Format:
  1194. * documents=
  1195. */
  1196. /**
  1197. * File to store resource info.
  1198. */
  1199. var $file = 'inc/conf/auth/resources/index.php';
  1200. }
  1201. ?>