1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
<?php
/** A-Select class for Gforge
*
* This file is part of Gforge
*
* This class, like Gforge, is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* FusionForge is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
class ASelect {
var $username;
var $organization;
var $attributes=array();
var $ticket;
function ASelect () {
if(isset($_COOKIE['aselectuid'])){
$this->username = $_COOKIE['aselectuid'];
} else {
$this->username = '';
}
if(isset($_COOKIE['aselectorganization'])){
$this->organization = $_COOKIE['aselectorganization'];
} else {
$this->organization = '';
}
if(isset($_COOKIE['aselectattributes'])){
$a = explode('&', $_COOKIE['aselectattributes']);
$i = 0;
while ($i < count($a)) {
$b = split('=', $a[$i]);
$this->$attributes[htmlspecialchars(urldecode($b[0]))] = htmlspecialchars(urldecode($b[1]));
$i++;
}
} else {
//nothing to be done here yet.
}
if(isset($_COOKIE['aselectticket'])){
$this->ticket = $_COOKIE['aselectticket'];
} else {
$this->ticket = '';
}
}
function getUserName () {
return $this->username;
}
function getOrganization () {
return $this->organization;
}
function getAttributes () {
return $this->attributes;
}
function getAttribute ($attribute) {
return $this->attributes[$attribute];
}
function getTicket () {
return $this->ticket;
}
}
|