Confirms a user by setting confirmed_at field to current time.

@param string $search Email or username
965258
public function actionConfirm($search)
    {
        $user = User::findByEmailOrMobile($search);
        if ($user === null) {
            $this->stdout(Yii::t('user', 'User is not found') . "\n", Console::FG_RED);
        } else {
            if ($user->setEmailConfirm()) {
                $this->stdout(Yii::t('user', 'User has been confirmed') . "\n", Console::FG_GREEN);
            } else {
                $this->stdout(Yii::t('user', 'Error occurred while confirming user') . "\n", Console::FG_RED);
            }
        }
    }
952013
public function findFirstUsersByName($search)
    {
        return $this->_em->createQueryBuilder()
            ->select(
                'u.id',
                "CONCAT(u.firstName, ' ', u.lastName, ' (', u.username, ')') AS name"
            )
            ->from('ClarolineCoreBundle:User', 'u')
            ->where('u.firstName LIKE :search')
            ->orWhere('u.lastName LIKE :search')
            ->orWhere('u.username LIKE :search')
            ->setMaxResults(5)
            ->setParameter(':search', "%{$search}%")
            ->getQuery()
            ->getArrayResult();
    }
799520
def confirm_user(user):
    
    if user.confirmed_at is not None:
        return False
    user.confirmed_at = _security.datetime_factory()
    _datastore.put(user)
    user_confirmed.send(app._get_current_object(), user=user)
    return True
192357
def confirm_reservation(self, username, domain, password, email=None):
        
        self.set_password(username=username, domain=domain, password=password)
        if email is not None:
            self.set_email(username=username, domain=domain, email=email)
829667
public function EmailConfirm($UserID, $EmailKey = '') {
      $User = $this->UserModel->GetID($UserID);
      
      if (!$User)
         throw NotFoundException('User');

      $EmailConfirmed = $this->UserModel->ConfirmEmail($User, $EmailKey);
      $this->Form->SetValidationResults($this->UserModel->ValidationResults());

      if ($EmailConfirmed) {
         $UserID = GetValue('UserID', $User);
         Gdn::Session()->Start($UserID);
      }

      $this->SetData('EmailConfirmed', $EmailConfirmed);
      $this->SetData('Email', $User->Email);
      $this->Render();
   }
1196032
public function getField($search)
    {
        return isset($this->data[$search])
            ? $this->data[$search]
            : null;
    }
273255
public function actionTagList($search = NULL)
  {
    $query = new Query;
    if(!is_Null($search))
    {
      $mainQuery = $query->select('name AS id, name AS text')->distinct()
        ->from('{{%tag}}')
        ->where('UPPER(name) LIKE "%'.strtoupper($search).'%"')
        ->limit(10);

      $command = $mainQuery->createCommand();
      $rows = $command->queryAll();
      $clean['results'] = array_values($rows);
    }
    $clean['results'][] = ['id'=>$search,'text'=>$search];
    header('Content-type: application/json');
    echo Json::encode($clean);
    exit();
  }
349247
public function find_users($search) {
        global $DB;
        list($wherecondition, $params) = $this->search_sql($search, 'u');
        $params['badgeid'] = $this->badgeid;
        $params['issuerrole'] = $this->issuerrole;

        list($esql, $eparams) = get_enrolled_sql($this->context, 'moodle/badges:earnbadge', 0, true);
        $fields = $this->required_fields_sql('u');
        list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);

        $params = array_merge($params, $eparams, $sortparams);
        $recipients = $DB->get_records_sql("SELECT $fields
                FROM {user} u
                JOIN ($esql) je ON je.id = u.id
                JOIN {badge_manual_award} s ON s.recipientid = u.id
                WHERE $wherecondition AND s.badgeid = :badgeid AND s.issuerrole = :issuerrole
                ORDER BY $sort", $params);

        return array(get_string('existingrecipients', 'badges') => $recipients);
    }
856329
public static function endWith($arg, $search) {
        foreach ((array) $search as $needle) {
            if ($needle != '' && strrchr($arg, $needle) === $needle) {
                return true;
            }
        }
        return false;
    }
415522
public function setSearch($search)
    {
        $this->_search = $search;
        $this->_queryBuilder->setSearch($search);
        return $this;
    }
531968
public function beforeUpdate($event)
    {
        $fields = $this->fields;
        $nowDate = gmdate($this->databaseTimeFormat);
        if (!$this->isActuallyDirty()) {
            return;
        }

        if (isset($this->fields['modifiedField']) && !$this->owner->isAttributeChanged($this->fields['modifiedField'])) {
            $this->owner->{$this->fields['modifiedField']} = $nowDate;
        }
        if (isset($this->fields['modifiedByField']) && !$this->owner->isAttributeChanged($this->fields['modifiedByField'])) {
            $this->owner->{$this->fields['modifiedByField']} = self::_getUserId();
        }
    }
34292
public function replace(string $search, string $replacement): self
    {
        if (!$this->contains($search)) {
            return $this;
        }

        return $this
            ->split($search)
            ->join($replacement);
    }
1071966
protected function searchField($search)
    {
        foreach ($this->data as $field) {
            if (method_exists($field, 'getField') && $find = $field->getField($search)) {
                return $find;
            }
        }
    }
502759
public function onFind($event)
    {
        if ($this->isAttributeWriteable($event) && $this->onBeforeFind($event)) {
            if ($this->i18n) {
                $event->sender->setAttribute($this->name, $this->i18nDecodedGetActive($this->i18nFieldDecode($event->sender->getAttribute($this->name), $this->i18nEmptyValue)));
            }
            
            $this->onAfterFind($event);
        }
    }
100033
function replace($search,$replace){
		$this->_String = str_replace($search,$replace,$this->_String);
	}
643333
public function find( $search ) {

		if ( ! is_array( $search ) ) {
			wp_die( 'LogicException: $search should be a [meta_key => val] array' );
		}

		if ( $search === [
			null => null,
		] ) {
			return false; // Abort search
		}

		if ( $this->paramSearchMeta( $search ) !== false ) {
			return true;
		}

		return false;
	}
1296368
public function setSearch($search)
    {
        $this->search = $search;
        $this->queryBuilder->setSearch($search || $this->globalSearch);
        return $this;
    }