Skip to content

Commit

Permalink
redesign and overhaul of site
Browse files Browse the repository at this point in the history
1. Added ability to edit email address and change password
2. Redesign of site. Now it actually looks decent
3. Added FAQ
4. Added ability to use pretty urls. Need rewrite written
5. Added passhash and salt to User class
  • Loading branch information
drakeapps committed Feb 22, 2013
1 parent 67185d8 commit f47aa23
Show file tree
Hide file tree
Showing 33 changed files with 2,555 additions and 359 deletions.
520 changes: 520 additions & 0 deletions AccountREADME.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -583,3 +583,9 @@ Link `555555` not returned since it was never updated.

PBKDF2 file from https://defuse.ca/php-pbkdf2.htm
Released under public domain

Blue icons from http://mebaze.com/freebies/bunch-of-cool-bluish-icons

1140 css grid from http://cssgrid.net/

laptop/iphone icon http://brsev.deviantart.com/
123 changes: 82 additions & 41 deletions addkey.php
Expand Up @@ -18,7 +18,7 @@
//$user = getUserInfo($_SESSION['user']);
$user = new User();
$user->login($session->user);
$title = "synccit - add device key";
$title = "device manager - synccit";
} else {
header("Location: index.php");
exit;
Expand Down Expand Up @@ -104,55 +104,96 @@


?>
<div id="center">
<span class="error"><?php echo $error; ?></span>
<form action="addkey.php" method="post">
<input type="hidden" name="hash" value="<?php echo $hash; ?>" />
<label for="device">add new device</label><br />
<input type="text" id="device" name="device" value="device name" class="text" onblur="if (this.value == '') {this.value = 'device name';}"
onfocus="if (this.value == 'device name') {this.value = '';}" />
<br />
<input type="submit" name="submit" value="add device" />
</form>
<br />
<div id="codelist">
<span class="leftside devicetitle">device name</span>
<span class="littlelink devicetitle">&nbsp;&nbsp;&nbsp;</span>
<span class="rightsidenocode devicetitle">auth code&nbsp;&nbsp;&nbsp;&nbsp;</span>

<br /><br />
<?php
for($i=0;$i<count($codes);$i++) {
echo "<span class=\"leftside\">";
echo $codes[$i]['description'];

echo "</span> ";

echo "<span class=\"littlelink\">";
echo "<a href=\"addkey.php?code=".$codes[$i]['code']."&amp;hash=$hash&do=remove\"

<div class="threecol">
<h2>device manager</h2>
<p class="deviceinfo">

<br />
<span class="bold">
username
</span>
<br />
<span class="mono">
<?php echo htmlspecialchars($user->username); ?>
</span>
<br />
</p>
<p class="deviceinfo">
<br />
<span class="bold">
API location
</span>
<br />
<span class="monosmall">
<?php echo $apiloc; ?>
</span>
<br />
</p>
</div>
<div class="sixcol">
<div class="devicetable">
<table>
<thead>
<tr>
<td>device name</td>
<td>auth code</td>
<td>rm</td>
</tr>
</thead>
<tbody>

<?php
for($i=0;$i<count($codes);$i++) {

$url = str_replace("@k", $codes[$i]['code'], DEVICESRMURL);
$url = str_replace("@h", $hash, $url);

echo "<tr>
<td>";
echo $codes[$i]['description'];

echo "</td> ";



echo "<td class=\"authcode\">";
echo $codes[$i]['code'];
echo "</td>";


echo "<td class=\"delete\">";
echo "<a href=\"$url\"
title=\"remove device key\"
onClick=\"return confirm('Are you sure you want to delete the key? Anything using this key will stop working')\">";


echo "&nbsp;&nbsp;&nbsp; [x]</a></span>";
echo "[x]</a></td>";

echo "<span class=\"rightside\">";
echo $codes[$i]['code'];
echo "</span>";
echo "</tr>";
}
?>

echo "<br />";
}
?>
</div>
<div id="apiusername">
<br />username<br />
<span class="apiurl"><?php echo htmlspecialchars($user->username); ?></span>

</tbody>
</table>
</div>
<div id="apiloc">
<br />API Location<br />
<span class="apiurl"><?php echo $apiloc; ?></span>

</div>
<div class="threecol last">
<div class="adddevice">
<br />
<span class="adddevicetitle">add device</span>
<span class="error"><?php echo $error; ?></span>
<form action="<?php echo DEVICESURL; ?>" method="post">
<input type="hidden" name="hash" value="<?php echo $hash; ?>" />
<input type="text" id="device" name="device" value="" class="text" placeholder="device name" />
<br />
<input type="submit" name="submit" value="add device"/>
</form>
</div>
</div>

<?php


Expand Down
6 changes: 6 additions & 0 deletions config.php
Expand Up @@ -21,6 +21,12 @@
$apiloc = "http://localhost/rsync/api/";


// Pretty URLs. Need server configured properly
$prettyurls = false;




$mysql = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
if($mysql->connect_errno) {
echo "database connection failure <!-- ".$mysql->connect_error." -->";
Expand Down
25 changes: 18 additions & 7 deletions create.php
Expand Up @@ -70,7 +70,7 @@
header("Location: login.php");
exit;
} else {
$r = $mysql->query("SELECT * FROM `user` WHERE `username` = '".mysql_real_escape_string($username)."' LIMIT 1");
$r = $mysql->query("SELECT * FROM `user` WHERE `username` = '".$mysql->real_escape_string($username)."' LIMIT 1");
if($r->num_rows > 0) {
$error = "username already exists";
} else {
Expand All @@ -86,29 +86,40 @@
htmlHeader("create account - synccit");

?>
<div id="center">

<div class="fourcol">
<h2>create new account</h2>
</div>
<div class="fourcol">
<span class="error"><?php echo $error; ?></span><br /><br />
<form action="create.php" method="post">

<input type="hidden" name="hash" value="<?php echo $hash; ?>" />
<label for="username">username</label><br />
<input type="text" id="username" name="username" value="<?php echo $username; ?>" class="text" />
<input type="text" id="username" name="username" value="<?php echo $username; ?>" class="textcreate" />
<br /><br />
<label for="password">password</label><br />
<input type="password" id="password" name="password" value="" class="text" />
<input type="password" id="password" name="password" value="" class="textcreate" />
<br /><br />
<label for="passwordconfirm">confirm password</label><br />
<input type="password" id="passwordconfirm" name="passwordconfirm" value="" class="text" />
<input type="password" id="passwordconfirm" name="passwordconfirm" value="" class="textcreate" />
<br /><br />
<label for="email">email</label><br />
<input type="text" id="email" name="email" value="<?php echo $email; ?>" class="text" />
<input type="text" id="email" name="email" value="<?php echo $email; ?>" class="textcreate" />
<br /><br />

<input type="submit" value="create" name="create" class="submit" />

</form>
</div>
<div class="fourcol last">
<p class="aside">
<span class="bold">Privacy</span>:<br /><br />
We won't reveal your username, password, or email to any third parties.
We won't spam your email or send out any unsolicited emails without a quick and easy way to unsubscribe.
Link information may be used for stats and other neat things, but the information will be kept anonymous.
For added security, use a different username and password than your reddit account.
</p>
</div>
<?php

htmlFooter();
130 changes: 130 additions & 0 deletions css/1140.css
@@ -0,0 +1,130 @@
/* CSS Resets */

html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,address,cite,code,del,dfn,em,img,ins,q,small,strong,sub,sup,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;margin:0;padding:0}article,aside,figure,figure img,figcaption,hgroup,footer,header,nav,section,video,object{display:block}a img{border:0}figure{position:relative}figure img{width:100%}


/* ==================================================================================================================== */
/* ! The 1140px Grid V2 by Andy Taylor \ http://cssgrid.net \ http://www.twitter.com/andytlr \ http://www.andytlr.com */
/* ==================================================================================================================== */

.container {
padding-left: 20px;
padding-right: 20px;
}

.row {
width: 100%;
max-width: 1140px;
min-width: 755px;
margin: 0 auto;
overflow: hidden;
}

.onecol, .twocol, .threecol, .fourcol, .fivecol, .sixcol, .sevencol, .eightcol, .ninecol, .tencol, .elevencol {
margin-right: 3.8%;
float: left;
min-height: 1px;
}

.row .onecol {
width: 4.85%;
}

.row .twocol {
width: 13.45%;
}

.row .threecol {
width: 22.05%;
}

.row .fourcol {
width: 30.75%;
}

.row .fivecol {
width: 39.45%;
}

.row .sixcol {
width: 48%;
}

.row .sevencol {
width: 56.75%;
}

.row .eightcol {
width: 65.4%;
}

.row .ninecol {
width: 74.05%;
}

.row .tencol {
width: 82.7%;
}

.row .elevencol {
width: 91.35%;
}

.row .twelvecol {
width: 100%;
float: left;
}

.last {
margin-right: 0px;
}

img, object, embed {
max-width: 100%;
}

img {
height: auto;
}


/* Smaller screens */

@media only screen and (max-width: 1023px) {

body {
font-size: 0.8em;
line-height: 1.5em;
}

}


/* Mobile */

@media handheld, only screen and (max-width: 767px) {

body {
font-size: 16px;
-webkit-text-size-adjust: none;
}

.row, body, .container {
width: 100%;
min-width: 0;
margin-left: 0px;
margin-right: 0px;
padding-left: 0px;
padding-right: 0px;
}

.row .onecol, .row .twocol, .row .threecol, .row .fourcol, .row .fivecol, .row .sixcol, .row .sevencol, .row .eightcol, .row .ninecol, .row .tencol, .row .elevencol, .row .twelvecol {
width: auto;
float: none;
margin-left: 0px;
margin-right: 0px;
padding-left: 20px;
padding-right: 20px;
}

}

0 comments on commit f47aa23

Please sign in to comment.