diff --git a/config.ini b/config.ini index 2cadddb9..c3c911dd 100644 --- a/config.ini +++ b/config.ini @@ -58,7 +58,17 @@ hidePost.own=moderator hidePost.all=moderator deletePost.own=moderator deletePost.all=moderator + listUsers=registered viewUser=registered +changeUserPassword.own=registered +changeUserPassword.all=admin +changeUserEmail.own=registered +changeUserEmail.all=admin +changeUserAccessRank=admin +changeUserName=moderator +acceptUserRegistration=moderator +banUser=admin + listComments=anonymous listTags=anonymous diff --git a/public_html/media/css/auth.css b/public_html/media/css/auth.css index 40a11206..c4d7be51 100644 --- a/public_html/media/css/auth.css +++ b/public_html/media/css/auth.css @@ -10,12 +10,10 @@ form.auth div { display: table-row; } -form.auth label { +form.auth label.left { display: table-cell; - text-align: right; float: left; width: 144px; - margin: 5px 16px 0 0; } form.auth input { @@ -30,7 +28,6 @@ form.auth input { form.auth button { display: block; - margin: 0 auto; } form.auth p { diff --git a/public_html/media/css/core.css b/public_html/media/css/core.css index 6b61ab38..17b16765 100644 --- a/public_html/media/css/core.css +++ b/public_html/media/css/core.css @@ -96,7 +96,6 @@ body { float: right; background: white; margin: 0 0.25em; - padding: 0.2em 0.5em; } #top-nav li.search input { border: 0; @@ -161,12 +160,57 @@ a:hover i[class*='icon-'] { background-color: red; } -input, -button { - font-family: inherit; +form.aligned input, +form.aligned button { + vertical-align: text-top; +} +form.aligned label { + text-align: right; + vertical-align: middle; +} +form.aligned label.left { + display: inline-block; + padding-right: 1em; + width: 5em; + min-height: 1em; + float: left; +} +form.aligned>div { + margin-bottom: 0.5em; + clear: left; +} +form.aligned label, +form.aligned input, +form.aligned select, +form.aligned button { + vertical-align: middle; + line-height: 20px; +} +form.aligned label, +form.aligned input, +form.aligned select { + padding: 5px; +} +form.aligned input[type=file] { + padding: 5px 0; +} +form.aligned input[type=radio], +form.aligned input[type=checkbox] { + vertical-align: text-top; } -input:not([type=radio]):not([type=checkbox]) { +label { + display: inline-block; +} + +label, +input, +select, +button { + font-family: inherit; + font-size: 11pt; +} +input:not([type=radio], [type=checkbox], [type=file]) { border: 1px solid #ccc; } button { @@ -209,3 +253,13 @@ footer { font-size: small; color: silver; } + +.inactive { + opacity: .5; +} + +hr { + background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAIElEQVQYlWNgQAPv3r37j4wHXBJdATY5BnyScAX4TAUAdfp5IbOdz/YAAAAASUVORK5CYII='); + border: 0; + height: 4px; +} diff --git a/public_html/media/css/paginator.css b/public_html/media/css/paginator.css index d128d9f9..72f05074 100644 --- a/public_html/media/css/paginator.css +++ b/public_html/media/css/paginator.css @@ -28,6 +28,6 @@ border-color: red; } -.paginator li.inactive a { +.paginator li.disabled a { color: gray; } diff --git a/public_html/media/css/post-view.css b/public_html/media/css/post-view.css index a972aa79..27252413 100644 --- a/public_html/media/css/post-view.css +++ b/public_html/media/css/post-view.css @@ -9,12 +9,12 @@ embed { max-width: 100%; } -.tags ul { +#sidebar .tags ul { list-style-type: none; margin: 0 0 0 1em; padding: 0; } -.tags li .count { +#sidebar .tags li .count { padding-left: 0.5em; color: silver; } @@ -28,10 +28,10 @@ nav .left { nav .right { float: right; } -nav a.inactive { +nav a.disabled { color: silver; } -nav a.inactive i[class*='icon-'] { +nav a.disabled i[class*='icon-'] { background-color: silver; } @@ -94,10 +94,6 @@ i.icon-dl { margin: 2px; } -.inactive { - opacity: .5; -} - form.edit { display: none; padding: 0.5em 1em; @@ -106,26 +102,9 @@ form.edit { padding-bottom: 0; margin: 1em 0; } - -form.edit>div { - margin-bottom: 0.5em; -} -form.edit input[type=checkbox], -form.edit label { - vertical-align: middle; - line-height: 33px; -} -form.edit label.left { - display: inline-block; - width: 5em; - float: left; -} form.edit .safety label:not(.left) { margin-right: 0.75em; } -form.edit>div { - clear: left; -} ul.tagit { display: block; vertical-align: middle; diff --git a/public_html/media/css/upload.css b/public_html/media/css/upload.css index 6a2af1d8..2fe8eac0 100644 --- a/public_html/media/css/upload.css +++ b/public_html/media/css/upload.css @@ -46,10 +46,6 @@ display: none; } -.inactive { - opacity: .5; -} - .post { margin-bottom: 4em; } diff --git a/public_html/media/css/user-view.css b/public_html/media/css/user-view.css index c81a3cea..c0e1bbbf 100644 --- a/public_html/media/css/user-view.css +++ b/public_html/media/css/user-view.css @@ -22,12 +22,27 @@ margin-bottom: -1px; } -.tabs li.active a { - border: 1px solid #eee; - border-bottom: 1px solid white; -} -.tabs li.inactive a { +.tabs li a { border: 1px solid white; border-bottom: 1px solid #eee; color: silver; } +.tabs li.selected a { + border: 1px solid #eee; + border-bottom: 1px solid white; + color: inherit; +} + +.avatar-wrapper { + text-align: center; +} + +.options ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +form.aligned label.left { + width: 10em; +} diff --git a/public_html/media/js/paginator-endless.js b/public_html/media/js/paginator-endless.js index b2b71089..8f698e8d 100644 --- a/public_html/media/js/paginator-endless.js +++ b/public_html/media/js/paginator-endless.js @@ -7,7 +7,7 @@ function scrolled() var pageDone = $(document).data('page-done'); if (pageNext == null) { - pageNext = $('.paginator .next:not(.inactive) a').attr('href'); + pageNext = $('.paginator .next:not(.disabled) a').attr('href'); } if (pageNext != null && pageNext != pageDone) { @@ -15,7 +15,7 @@ function scrolled() $.get(pageNext, [], function(response) { var dom = $(response); - var nextPage = dom.find('.paginator .next:not(.inactive) a').attr('href'); + var nextPage = dom.find('.paginator .next:not(.disabled) a').attr('href'); $(document).data('page-next', nextPage); $('.paginator-content').append($(response).find('.paginator-content').children().fadeIn('slow')); scrolled(); diff --git a/src/Controllers/UserController.php b/src/Controllers/UserController.php index 7f6a4aad..77253017 100644 --- a/src/Controllers/UserController.php +++ b/src/Controllers/UserController.php @@ -22,6 +22,24 @@ class UserController + /** + * @route /user/{name}/edit + * @validate name [^\/]+ + */ + public function editAction($name) + { + $this->context->viewName = 'user-view'; + $this->context->stylesheets []= 'user-view.css'; + $this->context->subTitle = $name; + PrivilegesHelper::confirmWithException($this->context->user, Privilege::ViewUser); + + $user = self::locateUser($name); + $this->context->transport->user = $user; + $this->context->transport->tab = 'edit'; + } + + + /** * @route /user/{name} * @route /user/{name}/{tab}/{page} diff --git a/src/Models/Model_User.php b/src/Models/Model_User.php index dad84910..4d4e2039 100644 --- a/src/Models/Model_User.php +++ b/src/Models/Model_User.php @@ -5,7 +5,7 @@ class Model_User extends RedBean_SimpleModel { $subject = !empty($this->email) ? $this->email - : $this->name; + : $this->pass_salt . $this->name; $hash = md5(strtolower(trim($subject))); $url = 'http://www.gravatar.com/avatar/' . $hash . '?s=' . $size . '&d=retro'; return $url; diff --git a/src/Models/Privilege.php b/src/Models/Privilege.php index cc7d088c..b8a5888a 100644 --- a/src/Models/Privilege.php +++ b/src/Models/Privilege.php @@ -14,7 +14,13 @@ class Privilege extends Enum const ListUsers = 11; const ViewUser = 12; + const BanUser = 13; + const AcceptUserRegistration = 14; + const ChangeUserPassword = 15; + const ChangeUserAccessRank = 16; + const ChangeUserEmail = 17; + const ChangeUserName = 18; - const ListComments = 13; - const ListTags = 14; + const ListComments = 19; + const ListTags = 20; } diff --git a/src/Views/auth-login.phtml b/src/Views/auth-login.phtml index 85838c9a..0016dbf3 100644 --- a/src/Views/auth-login.phtml +++ b/src/Views/auth-login.phtml @@ -1,16 +1,16 @@ -
+

If you don't have an account yet,
click here to create a new one.

- +
- +
@@ -19,6 +19,7 @@
+
diff --git a/src/Views/auth-register.phtml b/src/Views/auth-register.phtml index b1bdd931..c2393d5c 100644 --- a/src/Views/auth-register.phtml +++ b/src/Views/auth-register.phtml @@ -9,33 +9,33 @@

Your registration must be confirmed by staff.

-
+

Registered users can view more content,
upload files and add posts to favorites.

- - + +
- - + +
- - + +
- - + +
-

Your e-mail will be used to show your Gravatar.
Leave blank for random Gravatar.

+

Your e-mail will be used to show your Gravatar.
Leave blank for random Gravatar.

context->transport->errorMessage)): ?> @@ -45,6 +45,7 @@
+
diff --git a/src/Views/post-list.phtml b/src/Views/post-list.phtml index f19ae51d..c9cd69c0 100644 --- a/src/Views/post-list.phtml +++ b/src/Views/post-list.phtml @@ -48,7 +48,7 @@ if (!function_exists('pageUrl')) context->transport->page > 1): ?>