public function execute()
 {
     $this->newUsers = $this->getNewUsers();
     $this->newEvents = $this->getNewEvents();
     $this->newOrganizers = $this->getNewOrganizers();
     $this->issuesList = $this->getIssuesList();
     $this->joinRequests = $this->getJoinRequests();
     $numUpdates = count($this->newUsers) + count($this->newEvents) + count($this->newOrganizers) + count($this->issuesList) + count($this->joinRequests);
     if ($numUpdates > 0) {
         sendEmailToAdmins($this->getContent(), 'Admin newsletter for ' . date($this->dateFormat) . ', ' . $numUpdates . ' ' . Inflector::quantify('update', $numUpdates));
     }
 }
Example #2
0
 public function process()
 {
     global $db;
     $sql = 'INSERT INTO users (username, password, registered, email) VALUES (:username, :password, now(), :email) ';
     $stmt = $db->prepare($sql);
     $stmt->bindValue(':username', $this->getElementValue('username'));
     $stmt->bindValue(':password', sha1($this->getElementValue('password1')));
     $stmt->bindValue(':email', $this->getElementValue('email'));
     $stmt->execute();
     Logger::messageNormal('New user registration: ' . $this->getElementValue('username'), LocalEventType::CREATE_USER);
     sendEmailToAdmins('Username: '******'username'), 'New user registration: ' . $this->getElementValue('username'));
     redirect('loginregister.php?formLogin-username='******'username'), 'Registeration complete!');
 }