Skip to content
Permalink
Browse files

Prevent too many photo changed activities.

Remove deprecated call to UserModel->Get().
  • Loading branch information
tburry committed Sep 22, 2011
1 parent ab2aa9e commit e3d7ec1a9da81ce6240f0344e31ece55ee742733
@@ -534,7 +534,7 @@ public function Picture($UserReference = '', $Username = '') {
}
// If there were no errors, associate the image with the user
if ($this->Form->ErrorCount() == 0) {
if (!$this->UserModel->Save(array('UserID' => $this->User->UserID, 'Photo' => $UserPhoto)))
if (!$this->UserModel->Save(array('UserID' => $this->User->UserID, 'Photo' => $UserPhoto), array('CheckExisting' => TRUE)))
$this->Form->SetValidationResults($this->UserModel->ValidationResults());
}
// If there were no problems, redirect back to the user account
@@ -862,11 +862,11 @@ public function Save($FormPostValues, $Settings = FALSE) {
$Photo = ArrayValue('Photo', $FormPostValues);
if ($Photo !== FALSE) {
if (GetValue('CheckExisting', $Settings)) {
$User = $this->Get($UserID);
$User = $this->GetID($UserID);
$OldPhoto = GetValue('Photo', $User);
}
if (!isset($OldPhoto) || $Photo != $Photo) {
if (isset($OldPhoto) && $OldPhoto != $Photo) {
if (strpos($Photo, '//'))
$PhotoUrl = $Photo;
else
@@ -958,7 +958,7 @@ public function SaveAdminUser($FormPostValues) {
$Fields = $this->Validation->SchemaValidationFields(); // Only fields that are present in the schema
$Fields['UserID'] = 1;
if ($this->Get($UserID) !== FALSE) {
if ($this->GetID($UserID) !== FALSE) {
$this->SQL->Put($this->Name, $Fields);
} else {
// Insert the new user

0 comments on commit e3d7ec1

Please sign in to comment.
You can’t perform that action at this time.