original_string: public function doUpdate($data)
      {
          $filter = array();
          $member = Member::get()->byID($data["ID"]);
  
          $this->extend("onBeforeUpdate", $data);
  
          // Check that a member isn't trying to mess up another users profile
          if (Member::currentUserID() && $member->canEdit(Member::currentUser())) {
              try {
                  // Save member
                  $this->saveInto($member);
                  $member->write();
                  
                  $this->sessionMessage(
                      _t("Users.DETAILSUPDATED", "Account details updated"),
                      "success"
                  );
              } catch (Exception $e) {
                  $this->sessionMessage(
                      $e->getMessage(),
                      "warning"
                  );
              }
          } else {
              $this->sessionMessage(
                  _t("Users.CANNOTEDIT", "You cannot edit this account"),
                  "warning"
              );
          }
  
          $this->extend("onAfterUpdate", $data);
  
          return $this->controller->redirectBack();
      }
code: public function doUpdate($data)
      {
          $filter = array();
          $member = Member::get()->byID($data["ID"]);
  
          $this->extend("onBeforeUpdate", $data);
  
          // Check that a member isn't trying to mess up another users profile
          if (Member::currentUserID() && $member->canEdit(Member::currentUser())) {
              try {
                  // Save member
                  $this->saveInto($member);
                  $member->write();
                  
                  $this->sessionMessage(
                      _t("Users.DETAILSUPDATED", "Account details updated"),
                      "success"
                  );
              } catch (Exception $e) {
                  $this->sessionMessage(
                      $e->getMessage(),
                      "warning"
                  );
              }
          } else {
              $this->sessionMessage(
                  _t("Users.CANNOTEDIT", "You cannot edit this account"),
                  "warning"
              );
          }
  
          $this->extend("onAfterUpdate", $data);
  
          return $this->controller->redirectBack();
      }
code_tokens: public function doUpdate ( $ data ) { $ filter = array ( ) ; $ member = Member :: get ( ) -> byID ( $ data [ "ID" ] ) ; $ this -> extend ( "onBeforeUpdate" , $ data ) ; // Check that a member isn't trying to mess up another users profile if ( Member :: currentUserID ( ) && $ member -> canEdit ( Member :: currentUser ( ) ) ) { try { // Save member $ this -> saveInto ( $ member ) ; $ member -> write ( ) ; $ this -> sessionMessage ( _t ( "Users.DETAILSUPDATED" , "Account details updated" ) , "success" ) ; } catch ( Exception $ e ) { $ this -> sessionMessage ( $ e -> getMessage ( ) , "warning" ) ; } } else { $ this -> sessionMessage ( _t ( "Users.CANNOTEDIT" , "You cannot edit this account" ) , "warning" ) ; } $ this -> extend ( "onAfterUpdate" , $ data ) ; return $ this -> controller -> redirectBack ( ) ; }
docstring: Register a new member
  
  @param array $data User submitted data
  
  @return SS_HTTPResponse
docstring_tokens: Register a new member