-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataStructs.php
executable file
·85 lines (80 loc) · 2.24 KB
/
dataStructs.php
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
80
81
82
83
84
85
<?php
class User{
private $userName;
private $PasswordHash;
private $homeFolder;
private $Promitions;
function __construct($NewUserName, $NewPasswordHash, $NewPromitions){
$this->userName = $NewUserName;//sets all of the instance varuables
$this->PasswordHash = $NewPasswordHash;
$this->homeFolder = "home/".$this->userName;
$this->Promitions = $NewPromitions;
}
function createPublicSession(){ //this function creates _SESSION vauables for public use you do this to set the active user
$_SESSION['UserName'] = $this->userName;
$_SESSION['Promitions'] = $this->Promitions;
$_SESSION['Home'] = $this->homeFolder;
$_SESSION['pass'] = $this->PasswordHash;
}
function setGroup($newPromitions){
$this->Promitions = $newPromitions;
$this->saveChanges(); //saves the new promitions
}
function saveChanges(){
//i need to finnish this at some point
return 0;
}
function getUserName(){
return $this->userName;
}
function getPassHash(){
return $this->PasswordHash;
}
function gethomeFolder(){
return $this->homeFolder;
}
function getPromitions(){
return $this->Promitions;
}
}
/*
* this is class used to stor all of the exautables on the OS includeing apps, and settings
*/
class application{
private $appName;
private $appLocation;
private $iconLocation;
private $type; //this is "app" or "set"
function __construct($type, $name, $location, $icon="NULL"){
$this->type = $type;
$this->appName = $name;
$this->appLocation = $location;
$this->iconLocation = $this->findicon($icon);
}
private function findicon($iconLocation){
if ($iconLocation == "NULL"){
return "images/clone_icon.png";
} else {
return $iconLocation;
}
}
function renderAppString(){
if ($this->type == "app"){
return '<a href="apps/'.$this->appLocation.'"><div class="appIcon"><center><img src="
'.$this->iconLocation.'"></center><p>'.$this->appName.'</p></div></a>';
}else if($this->type == "set"){
return '<a href="'.$this->appLocation.'"><div class="appIcon2"><center><img src="
'.$this->iconLocation.'"></center><p>'.$this->appName.'</p></div></a>';
}
}
function getAppName(){
return $this->appName;
}
function getAppLocal(){
return $this->appLocation;
}
function getIconLocal(){
return $this->iconLocation;
}
}
?>