コード例 #1
0
 function getUserInfo($email, $password, $name, $language, $home)
 {
     $algorithm = $this->yellow->config->get("webinterfaceUserHashAlgorithm");
     $cost = $this->yellow->config->get("webinterfaceUserHashCost");
     $hash = $this->yellow->toolbox->createHash($password, $algorithm, $cost);
     if (!empty($hash)) {
         $email = strreplaceu(',', '-', $email);
         $hash = strreplaceu(',', '-', $hash);
         $name = strreplaceu(',', '-', empty($name) ? $this->yellow->config->get("sitename") : $name);
         $language = strreplaceu(',', '-', empty($language) ? $this->yellow->config->get("language") : $language);
         $status = strreplaceu(',', '-', empty($status) ? "active" : $status);
         $home = strreplaceu(',', '-', empty($home) ? $this->yellow->config->get("webinterfaceUserHome") : $home);
         $user = "******";
     }
     return $user;
 }
コード例 #2
0
ファイル: core.php プロジェクト: bell0956/bell0956
 function createTextTitle($text)
 {
     if (preg_match("/^.*\\/([\\w\\-]+)/", $text, $matches)) {
         $text = strreplaceu('-', ' ', ucfirst($matches[1]));
     }
     return $text;
 }
コード例 #3
0
ファイル: update.php プロジェクト: richi/yellow
 function getRawDataHome($language)
 {
     $rawData = "---\nTitle: Home\n---\n" . strreplaceu("\\n", "\n", $this->yellow->text->getText("webinterfaceInstallationHomePage", $language));
     return $rawData;
 }
コード例 #4
0
ファイル: webinterface.php プロジェクト: richi/yellow
 function update($fileName, $email, $password = "", $name = "", $language = "", $status = "", $modified = "", $pending = "", $home = "")
 {
     if (!empty($password)) {
         $hash = $this->createHash($password);
     }
     if ($this->isExisting($email)) {
         $email = strreplaceu(',', '-', $email);
         $hash = strreplaceu(',', '-', empty($hash) ? $this->users[$email]["hash"] : $hash);
         $name = strreplaceu(',', '-', empty($name) ? $this->users[$email]["name"] : $name);
         $language = strreplaceu(',', '-', empty($language) ? $this->users[$email]["language"] : $language);
         $status = strreplaceu(',', '-', empty($status) ? $this->users[$email]["status"] : $status);
         $modified = strreplaceu(',', '-', empty($modified) ? time() : $modified);
         $pending = strreplaceu(',', '-', empty($pending) ? $this->users[$email]["pending"] : $pending);
         $home = strreplaceu(',', '-', empty($home) ? $this->users[$email]["home"] : $home);
     } else {
         $email = strreplaceu(',', '-', empty($email) ? "none" : $email);
         $hash = strreplaceu(',', '-', empty($hash) ? "none" : $hash);
         $name = strreplaceu(',', '-', empty($name) ? $this->yellow->config->get("sitename") : $name);
         $language = strreplaceu(',', '-', empty($language) ? $this->yellow->config->get("language") : $language);
         $status = strreplaceu(',', '-', empty($status) ? $this->yellow->config->get("webinterfaceUserStatus") : $status);
         $modified = strreplaceu(',', '-', empty($modified) ? time() : $modified);
         $pending = strreplaceu(',', '-', empty($pending) ? $this->yellow->config->get("webinterfaceUserPending") : $pending);
         $home = strreplaceu(',', '-', empty($home) ? $this->yellow->config->get("webinterfaceUserHome") : $home);
     }
     $this->set($email, $hash, $name, $language, $status, $modified, $pending, $home);
     $fileData = $this->yellow->toolbox->readFile($fileName);
     foreach ($this->yellow->toolbox->getTextLines($fileData) as $line) {
         preg_match("/^\\s*(.*?)\\s*:\\s*(.*?)\\s*\$/", $line, $matches);
         if (!empty($matches[1]) && $matches[1] == $email) {
             $fileDataNew .= "{$email}: {$hash},{$name},{$language},{$status},{$modified},{$pending},{$home}\n";
             $found = true;
         } else {
             $fileDataNew .= $line;
         }
     }
     if (!$found) {
         $fileDataNew .= "{$email}: {$hash},{$name},{$language},{$status},{$modified},{$pending},{$home}\n";
     }
     return $this->yellow->toolbox->createFile($fileName, $fileDataNew);
 }
コード例 #5
0
 function normaliseClass($text)
 {
     return strreplaceu(array("+1", "-1", "_"), array("plus1", "minus1", "-"), $text);
 }