reformat designsettings.php
This commit is contained in:
parent
677434b113
commit
3a44885b7f
@ -33,8 +33,6 @@ if (!defined('LACONICA')) {
|
||||
|
||||
require_once INSTALLDIR.'/lib/accountsettingsaction.php';
|
||||
|
||||
|
||||
|
||||
class DesignsettingsAction extends AccountSettingsAction
|
||||
{
|
||||
/**
|
||||
@ -101,11 +99,11 @@ class DesignsettingsAction extends AccountSettingsAction
|
||||
$this->elementStart('ul', 'form_data');
|
||||
|
||||
//This is a JSON object in the DB field. Here for testing. Remove later.
|
||||
$userSwatch = '{"body":{"background-color":"#F0F2F5"},
|
||||
"#content":{"background-color":"#FFFFFF"},
|
||||
"#aside_primary":{"background-color":"#CEE1E9"},
|
||||
"html body":{"color":"#000000"},
|
||||
"a":{"color":"#002E6E"}}';
|
||||
$userSwatch = '{"body":{"background-color":"#F0F2F5"},'.
|
||||
'"#content":{"background-color":"#FFFFFF"},'.
|
||||
'"#aside_primary":{"background-color":"#CEE1E9"},'.
|
||||
'"html body":{"color":"#000000"},'.
|
||||
'"a":{"color":"#002E6E"}}';
|
||||
|
||||
//Default theme swatch -- Where should this be stored?
|
||||
$defaultSwatch = array('body' => array('background-color' => '#F0F2F5'),
|
||||
@ -154,7 +152,6 @@ else store in BD
|
||||
*/
|
||||
$this->elementEnd('fieldset');
|
||||
$this->elementEnd('form');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -168,63 +165,10 @@ else store in BD
|
||||
|
||||
function handlePost()
|
||||
{
|
||||
/*
|
||||
// CSRF protection
|
||||
|
||||
$token = $this->trimmed('token');
|
||||
if (!$token || $token != common_session_token()) {
|
||||
$this->showForm(_('There was a problem with your session token. '.
|
||||
'Try again, please.'));
|
||||
// TODO: implement this
|
||||
return;
|
||||
}
|
||||
|
||||
$user = common_current_user();
|
||||
assert(!is_null($user)); // should already be checked
|
||||
|
||||
// FIXME: scrub input
|
||||
|
||||
$newpassword = $this->arg('newpassword');
|
||||
$confirm = $this->arg('confirm');
|
||||
|
||||
# Some validation
|
||||
|
||||
if (strlen($newpassword) < 6) {
|
||||
$this->showForm(_('Password must be 6 or more characters.'));
|
||||
return;
|
||||
} else if (0 != strcmp($newpassword, $confirm)) {
|
||||
$this->showForm(_('Passwords don\'t match.'));
|
||||
return;
|
||||
}
|
||||
|
||||
if ($user->password) {
|
||||
$oldpassword = $this->arg('oldpassword');
|
||||
|
||||
if (!common_check_user($user->nickname, $oldpassword)) {
|
||||
$this->showForm(_('Incorrect old password'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$original = clone($user);
|
||||
|
||||
$user->password = common_munge_password($newpassword, $user->id);
|
||||
|
||||
$val = $user->validate();
|
||||
if ($val !== true) {
|
||||
$this->showForm(_('Error saving user; invalid.'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$user->update($original)) {
|
||||
$this->serverError(_('Can\'t save new password.'));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->showForm(_('Password saved.'), true);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add the Farbtastic stylesheet
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user