-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmiscClasses.php
169 lines (147 loc) · 3.7 KB
/
miscClasses.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
/*
phpALUGen - A PHP script to generate ActiveLock License and Product Keys
Miscellaneous Classes File
Copyright (C) 2005 Andy Schmitz
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
A human-readable summary of the LGPL is available at the following address:
http://creativecommons.org/licenses/LGPL/2.1/
*/
/**
* The file for miscellaneous classes and definitions.
*
* @author Andy Schmitz <[email protected]>
* @copyright Copyright (C) 2005 Andy Schmitz. Licensed under the GNU Lesser General Public License version 2.1
* @package phpALUGen
*/
/**
* A class for handling license information.
*
* @package phpALUGen
*/
class phpALUGen_License {
/**
* The name of the product the license is for
* @var string
*/
var $ProductName;
/**
* The version of the product the license is for
* @var string
*/
var $ProductVer;
/**
* The user the license is for
* @var string
*/
var $Licensee;
/**
* The VCode of the product (Public Key)
* @var string
*/
var $ProductKey;
/**
* The license key (RSA signature)
* @var string
*/
var $LicenseKey;
/**
* The registration level of the license (0 on up)
* @var integer
*/
var $RegisteredLevel;
/**
* The date the license was generated (YYYY/M/D)
* @var string
*/
var $RegisteredDate;
/**
* The expiration date of the license (YYYY/M/D)
* @var string
*/
var $Expiration;
/**
* The class of the license (Single user or Multiple)
* @var string
*/
var $LicenseClass;
/**
* The type of the license (Periodic (1), Permanent (2), or Time Locked (3))
* @var integer
*/
var $LicenseType;
/**
* The maximum number of times the product can be used
* @var integer
*/
var $MaxCount;
/**
* Generates a copy of the license's information in a string.
*
* @return string The license's information
*/
function toString() {
// An almost exact copy of ToString from the Visual Basic ActiveLock License class
$crLf = "\r\n";
$toString = $this->ProductName . $crLf;
$toString .= $this->ProductVer . $crLf;
$toString .= $this->LicenseClass . $crLf;
$toString .= $this->LicenseType . $crLf;
$toString .= $this->Licensee . $crLf;
$toString .= $this->RegisteredLevel . $crLf;
$toString .= $this->RegisteredDate . $crLf;
$toString .= $this->Expiration . $crLf;
$toString .= $this->MaxCount;
return $toString;
}
/**
* Generates a copy of this license to use for a liberation key.
*
* This requires LicenseKey to be set.
*
* @return string A string suitable for a liberation key
*/
function save() {
// An almost exact copy of Save from the Visual Basic ActiveLock License Class
$strOut = $this->toString() . "\r\n" . $this->LicenseKey; //add License Key at the end
$strOut = str_replace('=', '', base64_encode($strOut));
return $strOut;
}
}
/**
* A class for storing product information.
*
* @package phpALUGen
*/
class phpALUGen_ProductInfo {
/**
* The name of the product
* @var string
*/
var $Name;
/**
* The version of the product
* @var string
*/
var $Version;
/**
* The GCode for the product (Private Key)
* @var string
*/
var $GCode;
/**
* The VCode for the product (Public Key)
* @var string
*/
var $VCode;
}
?>