summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/all.php2
-rw-r--r--actions/designadminpanel.php53
-rw-r--r--actions/subscribers.php2
-rw-r--r--actions/subscriptions.php2
-rw-r--r--actions/userbyid.php2
-rw-r--r--lib/schema.php18
-rw-r--r--lib/util.php2
-rw-r--r--plugins/OpenID/finishaddopenid.php4
-rwxr-xr-xscripts/fixup_utf8.php8
9 files changed, 49 insertions, 44 deletions
diff --git a/actions/all.php b/actions/all.php
index 61cedce74..5a9d97dd7 100644
--- a/actions/all.php
+++ b/actions/all.php
@@ -160,7 +160,7 @@ class AllAction extends ProfileAction
function showPageTitle()
{
- $user =& common_current_user();
+ $user = common_current_user();
if ($user && ($user->id == $this->user->id)) {
$this->element('h1', null, _("You and friends"));
} else {
diff --git a/actions/designadminpanel.php b/actions/designadminpanel.php
index 8bc8c4450..f862aff0e 100644
--- a/actions/designadminpanel.php
+++ b/actions/designadminpanel.php
@@ -129,8 +129,6 @@ class DesignadminpanelAction extends AdminPanelAction
$bgimage = $this->saveBackgroundImage();
- common_debug("background image: $bgimage");
-
static $settings = array('theme', 'logo');
$values = array();
@@ -141,13 +139,28 @@ class DesignadminpanelAction extends AdminPanelAction
$this->validate($values);
- // assert(all values are valid);
+ $oldtheme = common_config('site', 'theme');
+
+ $config = new Config();
+
+ $config->query('BEGIN');
+
+ // Only update colors if the theme has not changed.
+
+ if ($oldtheme == $values['theme']) {
- $bgcolor = new WebColor($this->trimmed('design_background'));
- $ccolor = new WebColor($this->trimmed('design_content'));
- $sbcolor = new WebColor($this->trimmed('design_sidebar'));
- $tcolor = new WebColor($this->trimmed('design_text'));
- $lcolor = new WebColor($this->trimmed('design_links'));
+ $bgcolor = new WebColor($this->trimmed('design_background'));
+ $ccolor = new WebColor($this->trimmed('design_content'));
+ $sbcolor = new WebColor($this->trimmed('design_sidebar'));
+ $tcolor = new WebColor($this->trimmed('design_text'));
+ $lcolor = new WebColor($this->trimmed('design_links'));
+
+ Config::save('design', 'backgroundcolor', $bgcolor->intValue());
+ Config::save('design', 'contentcolor', $ccolor->intValue());
+ Config::save('design', 'sidebarcolor', $sbcolor->intValue());
+ Config::save('design', 'textcolor', $tcolor->intValue());
+ Config::save('design', 'linkcolor', $lcolor->intValue());
+ }
$onoff = $this->arg('design_background-image_onoff');
@@ -162,9 +175,11 @@ class DesignadminpanelAction extends AdminPanelAction
$tile = $this->boolean('design_background-image_repeat');
- $config = new Config();
+ // Hack to use Design's bit setter
+ $scratch = new Design();
+ $scratch->setDisposition($on, $off, $tile);
- $config->query('BEGIN');
+ Config::save('design', 'disposition', $scratch->disposition);
foreach ($settings as $setting) {
Config::save('site', $setting, $values[$setting]);
@@ -174,21 +189,7 @@ class DesignadminpanelAction extends AdminPanelAction
Config::save('design', 'backgroundimage', $bgimage);
}
- Config::save('design', 'backgroundcolor', $bgcolor->intValue());
- Config::save('design', 'contentcolor', $ccolor->intValue());
- Config::save('design', 'sidebarcolor', $sbcolor->intValue());
- Config::save('design', 'textcolor', $tcolor->intValue());
- Config::save('design', 'linkcolor', $lcolor->intValue());
-
- // Hack to use Design's bit setter
- $scratch = new Design();
- $scratch->setDisposition($on, $off, $tile);
-
- Config::save('design', 'disposition', $scratch->disposition);
-
$config->query('COMMIT');
-
- return;
}
/**
@@ -212,6 +213,10 @@ class DesignadminpanelAction extends AdminPanelAction
}
// XXX: Should we restore the default dir settings, etc.? --Z
+
+ // XXX: I can't get it to show the new settings without forcing
+ // this terrible reload -- FIX ME!
+ common_redirect(common_local_url('designadminpanel'), 303);
}
/**
diff --git a/actions/subscribers.php b/actions/subscribers.php
index df9ec9961..cc9452820 100644
--- a/actions/subscribers.php
+++ b/actions/subscribers.php
@@ -57,7 +57,7 @@ class SubscribersAction extends GalleryAction
function showPageNotice()
{
- $user =& common_current_user();
+ $user = common_current_user();
if ($user && ($user->id == $this->profile->id)) {
$this->element('p', null,
_('These are the people who listen to '.
diff --git a/actions/subscriptions.php b/actions/subscriptions.php
index cc7b38ee4..0dc5ee762 100644
--- a/actions/subscriptions.php
+++ b/actions/subscriptions.php
@@ -59,7 +59,7 @@ class SubscriptionsAction extends GalleryAction
function showPageNotice()
{
- $user =& common_current_user();
+ $user = common_current_user();
if ($user && ($user->id == $this->profile->id)) {
$this->element('p', null,
_('These are the people whose notices '.
diff --git a/actions/userbyid.php b/actions/userbyid.php
index 86a61f20b..ebff7e4a7 100644
--- a/actions/userbyid.php
+++ b/actions/userbyid.php
@@ -69,7 +69,7 @@ class UserbyidAction extends Action
if (!$id) {
$this->clientError(_('No id.'));
}
- $user =& User::staticGet($id);
+ $user = User::staticGet($id);
if (!$user) {
$this->clientError(_('No such user.'));
}
diff --git a/lib/schema.php b/lib/schema.php
index df7cb65f5..a8ba91b87 100644
--- a/lib/schema.php
+++ b/lib/schema.php
@@ -94,7 +94,7 @@ class Schema
public function getTableDef($name)
{
- $res =& $this->conn->query('DESCRIBE ' . $name);
+ $res = $this->conn->query('DESCRIBE ' . $name);
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
@@ -213,7 +213,7 @@ class Schema
$sql .= "); ";
- $res =& $this->conn->query($sql);
+ $res = $this->conn->query($sql);
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
@@ -234,7 +234,7 @@ class Schema
public function dropTable($name)
{
- $res =& $this->conn->query("DROP TABLE $name");
+ $res = $this->conn->query("DROP TABLE $name");
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
@@ -269,7 +269,7 @@ class Schema
$name = "$table_".implode("_", $columnNames)."_idx";
}
- $res =& $this->conn->query("ALTER TABLE $table ".
+ $res = $this->conn->query("ALTER TABLE $table ".
"ADD INDEX $name (".
implode(",", $columnNames).")");
@@ -291,7 +291,7 @@ class Schema
public function dropIndex($table, $name)
{
- $res =& $this->conn->query("ALTER TABLE $table DROP INDEX $name");
+ $res = $this->conn->query("ALTER TABLE $table DROP INDEX $name");
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
@@ -314,7 +314,7 @@ class Schema
{
$sql = "ALTER TABLE $table ADD COLUMN " . $this->_columnSql($columndef);
- $res =& $this->conn->query($sql);
+ $res = $this->conn->query($sql);
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
@@ -339,7 +339,7 @@ class Schema
$sql = "ALTER TABLE $table MODIFY COLUMN " .
$this->_columnSql($columndef);
- $res =& $this->conn->query($sql);
+ $res = $this->conn->query($sql);
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
@@ -363,7 +363,7 @@ class Schema
{
$sql = "ALTER TABLE $table DROP COLUMN $columnName";
- $res =& $this->conn->query($sql);
+ $res = $this->conn->query($sql);
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
@@ -446,7 +446,7 @@ class Schema
$sql = 'ALTER TABLE ' . $tableName . ' ' . implode(', ', $phrase);
- $res =& $this->conn->query($sql);
+ $res = $this->conn->query($sql);
if (PEAR::isError($res)) {
throw new Exception($res->getMessage());
diff --git a/lib/util.php b/lib/util.php
index 99a0a1db3..ab046e871 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -127,7 +127,7 @@ function common_check_user($nickname, $password)
if (0 == strcmp(common_munge_password($password, $user->id),
$user->password)) {
//internal checking passed
- $authenticatedUser =& $user;
+ $authenticatedUser = $user;
}
}
}
diff --git a/plugins/OpenID/finishaddopenid.php b/plugins/OpenID/finishaddopenid.php
index 6e889205d..7cd916523 100644
--- a/plugins/OpenID/finishaddopenid.php
+++ b/plugins/OpenID/finishaddopenid.php
@@ -80,7 +80,7 @@ class FinishaddopenidAction extends Action
function tryLogin()
{
- $consumer =& oid_consumer();
+ $consumer = oid_consumer();
$response = $consumer->complete(common_local_url('finishaddopenid'));
@@ -103,7 +103,7 @@ class FinishaddopenidAction extends Action
$sreg = $sreg_resp->contents();
}
- $cur =& common_current_user();
+ $cur = common_current_user();
$other = oid_get_user($canonical);
diff --git a/scripts/fixup_utf8.php b/scripts/fixup_utf8.php
index 5a9fba7c3..30befadfd 100755
--- a/scripts/fixup_utf8.php
+++ b/scripts/fixup_utf8.php
@@ -145,7 +145,7 @@ class UTF8FixerUpper
echo "$id...";
- $result =& $this->dbu->execute($sth, array($content, $rendered, $id));
+ $result = $this->dbu->execute($sth, array($content, $rendered, $id));
if (PEAR::isError($result)) {
echo "ERROR: " . $result->getMessage() . "\n";
@@ -209,7 +209,7 @@ class UTF8FixerUpper
echo "$id...";
- $result =& $this->dbu->execute($sth, array($fullname, $location, $bio, $id));
+ $result = $this->dbu->execute($sth, array($fullname, $location, $bio, $id));
if (PEAR::isError($result)) {
echo "ERROR: " . $result->getMessage() . "\n";
@@ -273,7 +273,7 @@ class UTF8FixerUpper
echo "$id...";
- $result =& $this->dbu->execute($sth, array($fullname, $location, $description, $id));
+ $result = $this->dbu->execute($sth, array($fullname, $location, $description, $id));
if (PEAR::isError($result)) {
echo "ERROR: " . $result->getMessage() . "\n";
@@ -330,7 +330,7 @@ class UTF8FixerUpper
echo "$id...";
- $result =& $this->dbu->execute($sth, array($content, $rendered, $id));
+ $result = $this->dbu->execute($sth, array($content, $rendered, $id));
if (PEAR::isError($result)) {
echo "ERROR: " . $result->getMessage() . "\n";