Userpage Profile Class.
More...
Userpage Profile Class.
Profile class extends class userpage
serve functions to check if the user is logged in and display the profile page on wich he can change his personal settings such as username, password and so on.
Class covers frontend functionality. See Methods Summary for Details!
- Author
- Daniel Retzl danie.nosp@m.lret.nosp@m.zl@gm.nosp@m.ail..nosp@m.com
- Copyright
- 2009-2015 Daniel Retzl
- Version
- 1.0.0
Definition at line 16 of file profile.php.
◆ drawProfile()
YAWK\PLUGINS\USERPAGE\profile::drawProfile |
( |
|
$db, |
|
|
|
$user |
|
) |
| |
draw user profile for frontend editing
- Parameters
-
object | $db | database |
object | $user | user object |
- Returns
- null store in object setting: $this->html
Definition at line 64 of file profile.php.
80 $this->html .=
"<form id=\"form\" class=\"form-inline\" action=\"welcome.html\" method=\"POST\">";
83 <legend><i class=\"fa fa-user\"></i> Profile Settings <small>Change your personal data.</small></legend>";
91 if ($changeUsername ===
'1'){
92 $this->html .=
"<small><i class=\"fa fa-user\"></i></small> Username<br>
93 <input type=\"text\" class=\"form-control\" id=\"newUsername\" name=\"newUsername\" value=\"$user->username\" placeholder=\"set new username\">
94 <label for=\"newUsername\" class=\"small\"> change your username</label> <br>";
97 if ($changeEmail ===
'0') {
98 $disabled =
"disabled aria-disabled=\"true\"";
99 $disabledLabel =
"The email address is part of your account and cannot be changed.";
103 $disabledLabel =
"change email address";
104 $this->html .=
"<small><i class=\"fa fa-envelope-o\"></i></small> Email<br>
105 <input type=\"text\" class=\"form-control\" value=\"$user->email\" id=\"newEmail\" name=\"newEmail\" $disabled placeholder=\"$user->email\">
106 <label for=\"newEmail\" class=\"small\"> $disabledLabel</label><br><br>";
109 if ($changePassword ===
'1'){
110 $this->html .=
"<small><i class=\"fa fa-lock\"></i></small> Password<br>
111 <input type=\"password\" class=\"form-control\" id=\"newPassword1\" name=\"newPassword1\" placeholder=\"****\">
112 <label for=\"newPassword1\" class=\"small\"> new password</label> <br>
113 <input type=\"password\" class=\"form-control\" id=\"newPassword2\" name=\"newPassword2\" placeholder=\"****\">
114 <label for=\"newPassword2\" class=\"small\"> new password <small>(again)</small></label> <br><br>";
117 if ($changeFirstname ===
'1'){
118 $this->html .=
"<small><i class=\"fa fa-user\"></i></small> First Name<br>
119 <input type=\"text\" class=\"form-control\" id=\"newFirstname\" name=\"firstname\" value=\"$user->firstname\" placeholder=\"set new firstname\">
120 <label for=\"newFirstname\" class=\"small\"> change your first name</label> <br>";
123 if ($changeLastname ===
'1'){
124 $this->html .=
"<small><i class=\"fa fa-user\"></i></small> Last Name<br>
125 <input type=\"text\" class=\"form-control\" id=\"newLastname\" name=\"lastname\" value=\"$user->lastname\" placeholder=\"set new lastname\">
126 <label for=\"newLastname\" class=\"small\"> change your last name</label> <br><br>";
129 if ($changeStreet ===
'1'){
130 $this->html .=
"<small><i class=\"fa fa-home\"></i></small> Street<br>
131 <input type=\"text\" class=\"form-control\" id=\"newStreet\" name=\"street\" value=\"$user->street\" placeholder=\"set new street\">
132 <label for=\"newStreet\" class=\"small\"> change your street</label> <br>";
135 if ($changeZipcode ===
'1'){
136 $this->html .=
"<small><i class=\"fa fa-home\"></i></small> Zipcode<br>
137 <input type=\"text\" class=\"form-control\" id=\"newZipcode\" name=\"zipcode\" value=\"$user->zipcode\" placeholder=\"set new zipcode\">
138 <label for=\"newZipcode\" class=\"small\"> change your zipcode</label> <br>";
141 if ($changeCity ===
'1'){
142 $this->html .=
"<small><i class=\"fa fa-home\"></i></small> City<br>
143 <input type=\"text\" class=\"form-control\" id=\"newCity\" name=\"city\" value=\"$user->city\" placeholder=\"set new city\">
144 <label for=\"newCity\" class=\"small\"> change your city</label> <br>";
147 if ($changeState ===
'1'){
148 $this->html .=
"<small><i class=\"fa fa-home\"></i></small> State<br>
149 <input type=\"text\" class=\"form-control\" id=\"newState\" name=\"state\" value=\"$user->country\" placeholder=\"set new state\">
150 <label for=\"newState\" class=\"small\"> change your state</label> ";
153 if ($changeCountry ===
'1'){
154 $this->html .=
"<small><i class=\"fa fa-home\"></i></small> Country<br>
155 <input type=\"text\" class=\"form-control\" id=\"newCountry\" name=\"country\" value=\"$user->country\" placeholder=\"set new country\">
156 <label for=\"newCountry\" class=\"small\"> change your country</label> ";
159 if ($changeUrl ===
'1'){
160 $this->html .=
"<br><small><i class=\"fa fa-external-link\"></i></small> Website URL*<br>
161 <input type=\"text\" class=\"form-control\" id=\"newUrl\" name=\"url\" size=\"42\" value=\"$user->url\" placeholder=\"set new website url\">
162 <label for=\"newUrl\" class=\"small\"> *optional</label> <br>";
165 if ($changeFacebook ===
'1'){
166 $this->html .=
"<small><i class=\"fa fa-facebook-official\"></i></small> Facebook URL*<br>
167 <input type=\"text\" class=\"form-control\" id=\"newFacebook\" size=\"42\" value=\"$user->facebook\" name=\"facebook\" placeholder=\"set new facebook url\">
168 <label for=\"newFacebook\" class=\"small\"> *optional</label> <br>";
171 if ($changeTwitter ===
'1'){
172 $this->html .=
"<small><i class=\"fa fa-twitter\"></i></small> Twitter URL*<br>
173 <input type=\"text\" class=\"form-control\" id=\"newTwitter\" size=\"42\" value=\"$user->twitter\" name=\"twitter\" placeholder=\"set new twitter url\">
174 <label for=\"newTwitter\" class=\"small\"> *optional</label> <br><br>";
177 $this->html .=
"<input type=\"submit\" name=\"submit\" value=\"Speichern\" class=\"btn btn-success\">";
178 $this->html .=
"<input type=\"hidden\" name=\"profile-update\" value=\"1\">";
179 $this->html .=
"<input type=\"hidden\" name=\"uid\" value=\"$user->id\">";
180 $this->html .=
"</fieldset><br><br><br>";
static getSetting($db, $property)
Get and return value for property from settings database.
References $db, and YAWK\settings\getSetting().
Referenced by YAWK\PLUGINS\USERPAGE\profile\init().
◆ init()
YAWK\PLUGINS\USERPAGE\profile::init |
( |
|
$db | ) |
|
init: check if user is logged in and draw profile or show login box
- Parameters
-
- Returns
- string html output
Definition at line 32 of file profile.php.
37 $this->username = $_SESSION[
'username'];
43 $user->loadProperties(
$db, $this->username);
53 echo \YAWK\alert::draw(
"danger",
"Error!",
"Obviously you are not correctly logged in. Please re-login!",
"",6800);
54 return \YAWK\user::drawLoginBox(
"",
"");
drawProfile($db, $user)
draw user profile for frontend editing
References $db, YAWK\PLUGINS\USERPAGE\profile\$html, YAWK\PLUGINS\USERPAGE\profile\$user, and YAWK\PLUGINS\USERPAGE\profile\drawProfile().
◆ $html
YAWK\PLUGINS\USERPAGE\profile::$html = '' |
|
protected |
◆ $settings
YAWK\PLUGINS\USERPAGE\profile::$settings |
|
protected |
◆ $user
YAWK\PLUGINS\USERPAGE\profile::$user |
|
protected |
◆ $username
YAWK\PLUGINS\USERPAGE\profile::$username |
|
protected |
The documentation for this class was generated from the following file:
- /var/www/htdocs/yawk.io/system/plugins/userpage/classes/profile.php