Пример #1
0
    ?>
<h2>Other accounts</h2>
<p>Click on account name to open it:</p>
<ul>
<?php 
    foreach ($manageable_accounts as $account) {
        if ($account->isTheSameAs($managed_account)) {
            ?>
<li><b><?php 
            echo UserTools::escape($account->getName());
            ?>
</b></li><?php 
        } else {
            ?>
<li><a href="<?php 
            echo UserConfig::$USERSROOTURL;
            ?>
/manage_account.php?account=<?php 
            echo $account->getID();
            ?>
"><?php 
            echo UserTools::escape($account->getName());
            ?>
</a></li><?php 
        }
    }
    ?>
</ul>
<?php 
}
require_once UserConfig::$footer;
Пример #2
0
function _USERBASE_render_navbox()
{
    $current_user = User::get();
    $accounts = array();
    if (UserConfig::$useAccounts && !is_null($current_user)) {
        $accounts = Account::getUserAccounts($current_user);
        $current_account = Account::getCurrentAccount($current_user);
    }
    ?>
<div id="navbox">
	<?php 
    if (!is_null($current_user)) {
        if (count($accounts) > 1) {
            ?>
<select id="account-picker" name="account" onchange="document.location.href='<?php 
            echo UserConfig::$USERSROOTURL;
            ?>
/change_account.php?return=/dashboard/&account='+this.value"><?php 
            foreach ($accounts as $account) {
                ?>
<option value="<?php 
                echo $account->getID();
                ?>
"<?php 
                if ($current_account->isTheSameAs($account)) {
                    echo ' selected';
                }
                ?>
><?php 
                echo UserTools::escape($account->getName());
                ?>
</option><?php 
            }
            ?>
</select>
		<?php 
        }
        if (UserConfig::$useAccounts && !is_null($current_account)) {
            ?>
			<!-- <span id="profile"><a href="/p/<?php 
            echo UserTools::escape($current_account->getID());
            ?>
/" title="<?php 
            echo UserTools::escape($current_account->getName());
            ?>
's public profile">Public profile</a></span> | -->
		<?php 
        }
        ?>
		<span id="username"><a href="<?php 
        echo UserConfig::$USERSROOTURL;
        ?>
/edit.php" title="<?php 
        echo UserTools::escape($current_user->getName());
        ?>
's user information"><?php 
        echo UserTools::escape($current_user->getName());
        ?>
</a></span> |
		<span id="logout"><a href="<?php 
        echo UserConfig::$USERSROOTURL;
        ?>
/logout.php">logout</a></span>
		<?php 
    } else {
        ?>
		<span id="signup"><a href="<?php 
        echo UserConfig::$USERSROOTURL;
        ?>
/register.php">Sign Up Now!</a></span> |
		<span id="login"><a href="<?php 
        echo UserConfig::$USERSROOTURL;
        ?>
/login.php">log in</a></span>
	<?php 
    }
    ?>
</div>
<?php 
}
Пример #3
0
    public function renderEditUserForm($action, $errors, $user, $data)
    {
        $db = UserConfig::getDB();
        $user_id = $user->getID();
        $module = $this->getID();
        $oauth_user_id = null;
        $serialized_userinfo = null;
        if ($stmt = $db->prepare('SELECT oauth_user_id, userinfo FROM ' . UserConfig::$mysql_prefix . 'user_oauth_identity WHERE user_id = ? AND module = ?')) {
            if (!$stmt->bind_param('is', $user_id, $module)) {
                throw new Exception("Can't bind parameter" . $stmt->error);
            }
            if (!$stmt->execute()) {
                throw new Exception("Can't execute statement: " . $stmt->error);
            }
            if (!$stmt->bind_result($oauth_user_id, $serialized_userinfo)) {
                throw new Exception("Can't bind result: " . $stmt->error);
            }
            $stmt->fetch();
            $stmt->close();
        } else {
            throw new Exception("Can't prepare statement: " . $db->error);
        }
        ?>
		<form action="<?php 
        echo $action;
        ?>
" method="POST">
		<?php 
        if (is_null($oauth_user_id)) {
            if (is_null($this->connectButtonURL)) {
                ?>
<input type="submit" name="add" value="Connect existing <?php 
                echo $this->getTitle();
                ?>
 account &gt;&gt;&gt;"/><?php 
            } else {
                ?>
<input type="image" name="add" src="<?php 
                echo UserTools::escape($this->connectButtonURL);
                ?>
" value="add"/><?php 
            }
        } else {
            ?>
			<div><?php 
            $this->renderUserInfo($serialized_userinfo);
            ?>
</div>
			<input type="hidden" name="oauth_user_id" value="<?php 
            echo htmlentities($oauth_user_id);
            ?>
"/>
			<input type="submit" name="remove" value="remove" style="font-size: xx-small"/>
			<?php 
        }
        ?>
		<input type="hidden" name="save" value="Save &gt;&gt;&gt;"/>
		</form>
		<?php 
    }
Пример #4
0
    public function renderEditUserForm($action, $errors, $user, $data)
    {
        ?>
		<style>
		#userbase-usernamepass-edit-form {
			font: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
			padding: 0.4em 1em;
			margin: 0;
			width: 520px;
			border: 4px solid #ccc;
			border-radius: 7px;
			-moz-border-radius: 7px;
			-webkit-border-radius: 7px;
		}

		#userbase-usernamepass-edit-form li {
			font-size: 1.2em;
			line-height: 1.5;

			clear: both;
			margin: 0 0 .75em;
			padding: 0;
		}

		#userbase-usernamepass-edit-form fieldset {
			border: 0;
			padding: 0;
			margin: 0;
		}

		#userbase-usernamepass-edit-form legend {
			border: 0;
			padding: 0;
			margin: 0;
			font-size: 1.8em;
			line-height: 1.8;
			padding-bottom: .6em;
		}

		#userbase-usernamepass-edit-form ul {
			list-style: none;
			margin: 0;
			padding: 0;
		}

		#userbase-usernamepass-edit-form label {
			display: block;
			float: left;
			line-height: 1.6;
			margin-right: 10px;
			text-align: right;
			width: 165px;
			padding: 3px 0;
		}

		#userbase-usernamepass-edit-form label:after {
			content: ':';
		}

		#userbase-usernamepass-edit-button {
			margin-left: 180px;
			padding: 0.3em 25px;
			cursor: pointer;
		}

		#userbase-usernamepass-edit-forgotpass {
			margin-left: 130px;
                        cursor: pointer;
			font-size: 0.6em;
			display: block;
		}

		#userbase-usernamepass-edit-form input {
			background: #f6f6f6;
			border: 2px solid #888;
			border-radius: 2px;
			-moz-border-radius: 2px;
			-webkit-border-radius: 2px;
			padding: 4px;
		}

		#userbase-usernamepass-edit-form input:focus {
			background: #fff;
		}

		#userbase-usernamepass-edit-form abbr {
			cursor: help;
			font-style: normal;
			border: 0;
			color: red;
			font-size: 1.2em;
			font-weight: bold;
		}

		#userbase-usernamepass-edit-form .userbase-usernamepass-edit-section {
			font-size: 1.5em;
			font-weight: bold;
			margin-top: 1em;
		}
		</style>
		<form id="userbase-usernamepass-edit-form" action="<?php 
        echo $action;
        ?>
" method="POST">
		<fieldset>
		<legend>Update your name, email and password</legend>
		<ul>
		<?php 
        $username = $user->getUsername();
        if (is_null($username)) {
            ?>
		<li><label>Username</label><input name="username" type="text" size="25" maxlength="25" value="<?php 
            echo array_key_exists('username', $data) ? UserTools::escape($data['username']) : '';
            ?>
"/><?php 
            echo array_key_exists('username', $errors) ? ' <span style="color:red" title="' . UserTools::escape(implode("\n", $errors['username'])) . '">*</span>' : '';
            ?>
</li>
		<?php 
        } else {
            ?>
		<li><label>Username</label><b title="Sorry, you can't change your username">&nbsp;<?php 
            echo UserTools::escape($username);
            ?>
</b></li>
		<?php 
        }
        ?>
		<li class="userbase-usernamepass-edit-section">Name and email</li>
		<li><label>Name</label><input name="name" type="test" size="40" value="<?php 
        echo UserTools::escape(array_key_exists('name', $data) ? $data['name'] : $user->getName());
        ?>
"/><?php 
        echo array_key_exists('name', $errors) ? ' <span style="color:red" title="' . UserTools::escape(implode("\n", $errors['name'])) . '">*</span>' : '';
        ?>
</li>
		<li><label>E-mail</label><input name="email" type="text" size="40" value="<?php 
        echo UserTools::escape(array_key_exists('email', $data) ? $data['email'] : $user->getEmail());
        ?>
"/><?php 
        echo array_key_exists('email', $errors) ? ' <span style="color:red" title="' . UserTools::escape(implode("\n", $errors['email'])) . '">*</span>' : '';
        ?>
</li>

		<li class="userbase-usernamepass-edit-section">Change password</li>
		<?php 
        if (!is_null($user->getUsername())) {
            ?>
		<li><label>Current password</label><input name="currentpass" type="password" size="25" autocomplete="off"/><?php 
            echo array_key_exists('currentpass', $errors) ? ' <span style="color:red" title="' . UserTools::escape(implode("\n", $errors['currentpass'])) . '">*</span>' : '';
            ?>
</li>
		<?php 
        }
        ?>
		<li><label><?php 
        if (is_null($user->getUsername())) {
            ?>
Set a<?php 
        } else {
            ?>
New<?php 
        }
        ?>
 password</label><input name="pass" type="password" size="25" autocomplete="off"/><?php 
        echo array_key_exists('pass', $errors) ? ' <span style="color:red" title="' . UserTools::escape(implode("\n", $errors['pass'])) . '">*</span>' : '';
        ?>
</li>
		<li><label>Repeat new password</label><input name="repeatpass" type="password" size="25" autocomplete="off"/><?php 
        array_key_exists('repeatpass', $errors) ? ' <span style="color:red" title="' . UserTools::escape(implode("\n", $errors['repeatpass'])) . '">*</span>' : '';
        ?>
</li>
		<li><button id="userbase-usernamepass-edit-button" type="submit" name="save">Save</button></li>
		</ul>
		</fieldset>
		</form>
		<?php 
    }
Пример #5
0
        $cohort_provider = $provider;
        $selected = true;
    }
    ?>
<option value="<?php 
    echo UserTools::escape($id);
    ?>
"<?php 
    if ($selected) {
        ?>
 selected="yes"<?php 
    }
    ?>
>
	<?php 
    echo UserTools::escape($provider->getTitle());
    ?>
	</option><?php 
}
if (is_null($cohort_provider)) {
    $cohort_provider = UserConfig::$cohort_providers[0];
}
?>
</select>
</div>

</form>
</div>

<?php 
$cohort_lookup = array();
Пример #6
0
#userbase-passwordreset-form input:focus {
	background: #fff;
}
</style>


<div id="userbase-passwordreset">
<h2>Password reset</h2>

<form id="userbase-passwordreset-form" action="" method="POST">
<fieldset>
<legend>Please enter new password</legend>
<ul>
<li><label>New password</label><input name="pass" type="password" size="25" autocomplete="off"/><?php 
echo array_key_eXists('pass', $errors) ? ' <span style="color:red" title="' . UserTools::escape($errors['pass']) . '">*</span>' : '';
?>
</li>
<li><label>Repeat new password</label><input name="repeatpass" type="password" size="25" autocomplete="off"/><?php 
echo array_key_exists('repeatpass', $errors) ? ' <span style="color:red" title="' . UserTools::escape($errors['repeatpass']) . '">*</span>' : '';
?>
</li>
<li><button id="userbase-passwordreset-button" type="submit" name="save">Save changes</button></li>
</ul>
</fieldset>
</form>

</div>

<?php 
require_once UserConfig::$footer;
Пример #7
0
        if (!$feature->isEnabled()) {
            ?>
 style="text-decoration: line-through"<?php 
        }
        ?>
>
		<input id="feature_<?php 
        echo UserTools::escape($feature->getID());
        ?>
" type="checkbox" name="feature[<?php 
        echo UserTools::escape($feature->getID());
        ?>
]"<?php 
        echo $feature->isEnabledForUser($user) ? ' checked="true"' : '';
        ?>
>
		<label for="feature_<?php 
        echo UserTools::escape($feature->getID());
        ?>
"><?php 
        echo UserTools::escape($feature->getName());
        ?>
</label>
		</div><?php 
    }
    ?>
	<input type="submit" name="savefeatures" value="update features">
	</form>
<?php 
}
require_once dirname(__FILE__) . '/footer.php';
Пример #8
0
 public function getHTML()
 {
     return '<a href="http://www.ohloh.net/accounts/' . UserTools::escape($user_info['id']) . '" target="_blank">@' . $this->userinfo['name'] . '</a>';
 }
Пример #9
0
 public function getHTML()
 {
     return '<a href="http://twitter.com/' . UserTools::escape($this->userinfo['screen_name']) . '" target="_blank">@' . $this->userinfo['screen_name'] . '</a>';
 }
Пример #10
0
			}

			#userbase-invite-code {
				width: 290px;
			}
			</style>

			<form id="userbase-invitation-form" action="" method="GET">
			<fieldset>
			<legend><?php 
            echo $message;
            ?>
</legend>
			<p>
			<input id="userbase-invite-code" name="invite" size="30" value="<?php 
            echo UserTools::escape($_GET['invite']);
            ?>
"/>
			<button id="userbase-invitation-button" type="submit">&gt;&gt;</button>
			</p>
			</fieldset>
			</form>
			<?php 
        }
    }
    if ($show_registration_form) {
        foreach (UserConfig::$authentication_modules as $module) {
            $id = $module->getID();
            ?>
			<div style="margin-bottom: 2em">
			<h3 name="<?php 
Пример #11
0
            ?>
</div>
		<?php 
        }
    }
    ?>
</td>
	<td><a href="user.php?id=<?php 
    echo $userid;
    ?>
"><?php 
    echo UserTools::escape($user->getName());
    ?>
</a></td>
	<td><?php 
    echo UserTools::escape($user->getEmail());
    ?>
</td>
	<td><?php 
    $points = $user->getPoints();
    if ($points > 0) {
        ?>
<a href="./activity.php?userid=<?php 
        echo $userid;
        ?>
"><?php 
        echo $points;
        ?>
</a><?php 
    }
    ?>
Пример #12
0
    public function renderEditUserForm($action, $errors, $user, $data)
    {
        $fb_id = $user->getFacebookID();
        if (is_null($fb_id)) {
            $this->renderForm($action, 'connect');
        } else {
            $facebook = new Facebook(array('appId' => $this->appID, 'secret' => $this->secret, 'cookie' => true));
            try {
                $me = $facebook->api('/' . $fb_id);
            } catch (FacebookApiException $e) {
                error_log("Can't get /me API data");
                return null;
            }
            ?>
			<table><tr>
			<td rowspan="2"><a href="<?php 
            echo $me['link'];
            ?>
" target="_blank"><img src="http://graph.facebook.com/<?php 
            echo $fb_id;
            ?>
/picture" style="border: 0; max-width: 100px; max-height: 100px" title="<?php 
            echo UserTools::escape($me['name']);
            ?>
"></a></td>
			<td><a href="<?php 
            echo UserTools::escape($me['link']);
            ?>
" target="_blank"><?php 
            echo $me['name'];
            ?>
</a></td>
			</tr><tr>
			<td>
			<form action="<?php 
            echo $action;
            ?>
" method="POST" name="facebookusereditform">
			<input type="hidden" name="save" value="Save &gt;&gt;&gt;"/>
			<input type="submit" name="remove" value="remove" style="font-size: xx-small"/>
			</form>
			</td>
			</tr></table>
		<?php 
        }
    }
Пример #13
0
        ?>
</a></td>
	<td><?php 
        echo $act[1];
        ?>
</td>
	<?php 
    }
    if (is_null($activityuser)) {
        ?>
		<td>
		<a href="user.php?id=<?php 
        echo $user->getID();
        ?>
"><?php 
        echo UserTools::escape($user->getName());
        ?>
</a> (<a href="activity.php?userid=<?php 
        echo $user->getID();
        ?>
">user activity</a>)
		</td>
	<?php 
    }
    ?>
</tr><?php 
}
?>
<tr><td colspan="6">
<?php 
if (count($activities) == $perpage) {
Пример #14
0
 public function getHTML()
 {
     return '<a href="' . UserTools::escape($this->userinfo['link']) . '" target="_blank">' . $this->userinfo['name'] . '</a>';
 }
Пример #15
0
<h2>Accepted Invitations</h2>
<table cellpadding="5" cellspacing="0" border="1" width="100%">
<tr><th>Code</th><th>By</th><th>Sent To</th><th>User</th></tr>
<?php 
    foreach ($invitations as $invitation) {
        ?>
<tr>
		<td><?php 
        echo UserTools::escape($invitation->getCode());
        ?>
</td>
		<td><?php 
        // echo UserTools::escape(User::getUser($invitation->getIssuer())->getUserName())
        ?>
</td>
		<td><?php 
        echo UserTools::escape($invitation->getComment());
        ?>
</td>
		<td><?php 
        echo UserTools::escape($invitation->getUser()->getUserName());
        ?>
</td>
		</tr><?php 
    }
}
?>
</table>

</div><?php 
require_once UserConfig::$footer;