Пример #1
0
 public function save()
 {
     foreach ($this->getUsers() as $user) {
         UserServiceUtil::updateUser($user);
     }
     MessageUtil::info("Users were succesfully updated!");
     return null;
 }
Пример #2
0
 public function testFindFileNameToCategoryToMessage()
 {
     $path = Zurmo::getPathOfAlias('application.core.tests.unit.modules');
     $result = MessageUtil::findFileNameToCategoryToMessage($path, '', true);
     $this->assertContains('A message for test translation with no line break', $result[$path . '/TestModule.php']['Core']);
     $this->assertContains('A message for test translation with two line breaks', $result[$path . '/TestModule.php']['Core']);
     $this->assertContains('A message for test translation with many line breaks', $result[$path . '/TestModule.php']['Core']);
 }
Пример #3
0
 public function doRender($rowIndex = null)
 {
     if (!MessageUtil::hasMessage()) {
         return "";
     }
     $msgObj = MessageUtil::getMessage();
     $sev = $msgObj->getSeverity();
     $msg = $msgObj->getMessage();
     return "<div class=\"msg {$sev}\">{$msg}</div>";
 }
Пример #4
0
 public function add()
 {
     try {
         $word = $this->addWord();
         MessageUtil::info("Word {$word->getWord()} was added to the list - {$word->getPoints($this->pointsList)} point(s)");
     } catch (BoggleWordException $e) {
         MessageUtil::error($e->getMessage());
     }
     $this->word = "";
     return null;
 }
 /**
  * @see Form::readFormParameters()
  */
 public function readFormParameters()
 {
     parent::readFormParameters();
     if (isset($_POST['subject'])) {
         $this->subject = StringUtil::trim($_POST['subject']);
     }
     if (isset($_POST['text'])) {
         $this->text = MessageUtil::stripCrap(StringUtil::trim($_POST['text']));
     }
     if (isset($_POST['activeTab'])) {
         $this->activeTab = $_POST['activeTab'];
     }
     // wysiwyg
     if (isset($_POST['wysiwygEditorMode'])) {
         $this->wysiwygEditorMode = intval($_POST['wysiwygEditorMode']);
     }
     if (isset($_POST['wysiwygEditorHeight'])) {
         $this->wysiwygEditorHeight = intval($_POST['wysiwygEditorHeight']);
     }
     // settings
     $this->enableSmilies = $this->enableHtml = $this->enableBBCodes = $this->parseURL = $this->showSignature = 0;
     if (isset($_POST['parseURL'])) {
         $this->parseURL = intval($_POST['parseURL']);
     }
     if (isset($_POST['enableSmilies'])) {
         $this->enableSmilies = intval($_POST['enableSmilies']);
     }
     $this->enableSmilies = intval($this->enableSmilies && WCF::getUser()->getPermission('user.' . $this->permissionType . '.canUseSmilies'));
     if (isset($_POST['enableHtml'])) {
         $this->enableHtml = intval($_POST['enableHtml']);
     }
     $this->enableHtml = intval($this->enableHtml && WCF::getUser()->getPermission('user.' . $this->permissionType . '.canUseHtml'));
     if (isset($_POST['enableBBCodes'])) {
         $this->enableBBCodes = intval($_POST['enableBBCodes']);
     }
     $this->enableBBCodes = intval($this->enableBBCodes && WCF::getUser()->getPermission('user.' . $this->permissionType . '.canUseBBCodes'));
     if (isset($_POST['showSignature'])) {
         $this->showSignature = intval($_POST['showSignature']);
     }
     // stop shouting
     if (StringUtil::length($this->subject) >= MESSAGE_SUBJECT_STOP_SHOUTING && StringUtil::toUpperCase($this->subject) == $this->subject) {
         $this->subject = StringUtil::wordsToUpperCase(StringUtil::toLowerCase($this->subject));
     }
 }
Пример #6
0
 public function sendNotify($toUid, $node, $config)
 {
     empty($config) && ($config = array());
     $nodeInfo = $this->getNode($node);
     if (!$nodeInfo) {
         return false;
     }
     !is_array($toUid) && ($toUid = explode(",", $toUid));
     $userInfo = User::model()->fetchAllByUids($toUid);
     $data["node"] = $node;
     $data["module"] = $nodeInfo["module"];
     $data["url"] = isset($config["{url}"]) ? $config["{url}"] : "";
     $data["title"] = Ibos::lang($nodeInfo["titlekey"], "", $config);
     if (empty($nodeInfo["contentkey"])) {
         $data["body"] = $data["title"];
         $hasContent = false;
     } else {
         $data["body"] = Ibos::lang($nodeInfo["contentkey"], "", $config);
         $hasContent = true;
     }
     MessageUtil::push("notify", $toUid, array("message" => $data["title"], "url" => $data["url"]));
     foreach ($userInfo as $v) {
         $data["uid"] = $v["uid"];
         !empty($nodeInfo["sendmessage"]) && NotifyMessage::model()->sendMessage($data);
         $data["email"] = $v["email"];
         $remindSetting = !empty($v["remindsetting"]) ? unserialize($v["remindsetting"]) : array();
         if (isset($remindSetting[$node]) && isset($remindSetting[$node]["app"]) && $remindSetting[$node]["app"] == 1) {
             MessageUtil::appPush($toUid, $data["title"]);
         }
         if (!empty($nodeInfo["sendemail"])) {
             if (isset($remindSetting[$node]) && isset($remindSetting[$node]["email"]) && $remindSetting[$node]["email"] == 1) {
                 NotifyEmail::model()->sendEmail($data, $hasContent);
             }
         }
         if (!empty($nodeInfo["sendsms"])) {
             if (isset($remindSetting[$node]) && isset($remindSetting[$node]["sms"]) && $remindSetting[$node]["sms"] == 1) {
                 MessageUtil::sendSms($v["mobile"], StringUtil::filterCleanHtml($data["title"]), $nodeInfo["module"], $v["uid"]);
             }
         }
     }
 }
Пример #7
0
 public function actionSyncUser()
 {
     $type = EnvUtil::getRequest("type");
     $uid = StringUtil::filterStr(EnvUtil::getRequest("uid"));
     $flag = intval(EnvUtil::getRequest("flag"));
     $pwd = EnvUtil::getRequest("pwd");
     if (MessageUtil::getIsImOpen($type)) {
         $im = Ibos::app()->setting->get("setting/im");
         $imCfg = $im[$type];
         $className = "ICIM" . ucfirst($type);
         $factory = new ICIMFactory();
         $properties = array("uid" => explode(",", $uid), "syncFlag" => $flag);
         if ($type == "rtx") {
             $properties["pwd"] = $pwd;
         }
         $adapter = $factory->createAdapter($className, $imCfg, $properties);
         return $adapter !== false ? $adapter->syncUser() : EnvUtil::iExit("初始化IM组件失败");
     } else {
         EnvUtil::iExit("未开启IM绑定");
     }
 }
Пример #8
0
 */
 $error = 0;
 if (!$_POST["subject"]) {
     $error++;
     $page .= "<center><br><font color=#FF0000>{$lang['No_Subject']}<br></font></center>";
 }
 if (!$_POST["text"]) {
     $error++;
     $page .= "<center><br><font color=#FF0000>{$lang['No_Text']}<br></font></center>";
 }
 if ($error == 0) {
     $page .= "<center><font color=#00FF00>Nachricht erfolgreich verschickt!<br></font></center>";
     require_once WCF_DIR . 'lib/data/message/bbcode/MessageParser.class.php';
     $parser = MessageParser::getInstance();
     $parser->setOutputType('text/html');
     $message = MessageUtil::stripCrap(StringUtil::trim($_POST['text']));
     $message = $parser->parse($message);
     //query para agregar un mensaje
     require_once LW_DIR . 'lib/data/message/MessageEditor.class.php';
     $recipentID = intval($_GET['id']);
     $subject = escapeString(StringUtil::encodeHTML($_POST['subject']));
     MessageEditor::create($recipentID, $subject, $message);
     /*doquery("INSERT INTO {{table}} SET
     				`message_owner`='".intval($_GET['id'])."',
     				`message_sender`='{$user['id']}',
     				`message_time`='".time()."',
     				`message_type`='1',
     				`message_from`='{$user['username']} [{$user['galaxy']}:{$user['system']}:{$user['planet']}]',
     				`message_subject`='".WCF::getDB()->escapeString(StringUtil::encodeHTML($_POST['subject']))."',
     				`message_text`='".WCF::getDB()->escapeString($message)."'"
     				,'messages');
Пример #9
0
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * Zurmo is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
 * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
 *
 * The interactive user interfaces in original and modified versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the Zurmo
 * logo and Zurmo copyright notice. If the display of the logo is not reasonably
 * feasible for technical reasons, the Appropriate Legal Notices must display the words
 * "Copyright Zurmo Inc. 2014. All rights reserved".
 ********************************************************************************/
return MessageUtil::getMessages('fr');
Пример #10
0
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * Zurmo is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
 * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
 *
 * The interactive user interfaces in original and modified versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the Zurmo
 * logo and Zurmo copyright notice. If the display of the logo is not reasonably
 * feasible for technical reasons, the Appropriate Legal Notices must display the words
 * "Copyright Zurmo Inc. 2014. All rights reserved".
 ********************************************************************************/
return MessageUtil::getMessages('de');
Пример #11
0
 private function checkImUnique($arr)
 {
     foreach ($arr as $type) {
         if (MessageUtil::getIsImOpen($type)) {
             $this->error(Ibos::lang("Binding unique error"));
         }
     }
 }
Пример #12
0
 private function makeVerify($op, $data, $val)
 {
     if ($op == "email") {
         $message = Ibos::lang("Verify email content", "", array("{code}" => $val, "{date}" => ConvertUtil::formatDate(TIMESTAMP, "d")));
         if (CloudApi::getInstance()->isOpen() && CloudApi::getInstance()->exists("mail_send")) {
             $res = MailUtil::sendCloudMail($data, Ibos::lang("Verify email title"), $message);
         } else {
             $res = MailUtil::sendMail($data, Ibos::lang("Verify email title"), $message);
         }
     } elseif ($op == "mobile") {
         $message = Ibos::lang("Verify mobile content", "", array("{code}" => $val));
         $res = MessageUtil::sendSms($data, $message, "user", $this->getUid());
     }
     return $res;
 }
Пример #13
0
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * Zurmo is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
 * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
 *
 * The interactive user interfaces in original and modified versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the Zurmo
 * logo and Zurmo copyright notice. If the display of the logo is not reasonably
 * feasible for technical reasons, the Appropriate Legal Notices must display the words
 * "Copyright Zurmo Inc. 2013. All rights reserved".
 ********************************************************************************/
return MessageUtil::getMessages('it');
Пример #14
0
 public function delete($userId)
 {
     UserServiceUtil::deleteUser($userId);
     MessageUtil::info("Gebruiker werd succesvol verwijderd!");
     return null;
 }
Пример #15
0
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 *
 * Zurmo is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 *
 * You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
 * Suite 370 Chicago, IL 60606. or at email address contact@zurmo.com.
 *
 * The interactive user interfaces in original and modified versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 *
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the Zurmo
 * logo and Zurmo copyright notice. If the display of the logo is not reasonably
 * feasible for technical reasons, the Appropriate Legal Notices must display the words
 * "Copyright Zurmo Inc. 2013. All rights reserved".
 ********************************************************************************/
return MessageUtil::getMessages('es');
Пример #16
0
 private static function setMessage($severity, $msg)
 {
     self::$msg = new BeanMessage($severity, $msg);
 }
Пример #17
0
 public function actionExport()
 {
     $id = EnvUtil::getRequest("id");
     $id = StringUtil::filterStr($id);
     MessageUtil::exportSms($id);
 }
Пример #18
0
 public static function checkFirstLanguagesMessageFilesContainAllExistingMessages($messagesDirectoryName, $moduleName, $basePath)
 {
     assert('is_string($messagesDirectoryName)');
     assert('is_dir   ($messagesDirectoryName)');
     $problems = array();
     $fileNamesToCategoriesToMessages = static::findFileNameToCategoryToMessage($messagesDirectoryName . '/..');
     $categoriesToMessagesToFileNames = static::convertFileNameToCategoryToMessageToCategoryToMessageToFileName($fileNamesToCategoriesToMessages);
     unset($categoriesToMessagesToFileNames['yii']);
     $languages = static::getLanguages($messagesDirectoryName);
     if (count($languages) > 0) {
         $firstLanguage = $languages[0];
         foreach ($categoriesToMessagesToFileNames as $category => $messagesToFileNames) {
             $existingMessages = array_keys(MessageUtil::getMessages($firstLanguage, $moduleName, $category));
             $duplicateCount = count($existingMessages) != count(array_unique($existingMessages));
             if ($duplicateCount != 0) {
                 $problems[] = "{$moduleName} and its dependencies contain {$duplicateCount} duplicate entries.";
             }
             $yiiMessageFileName = "{$messagesDirectoryName}/{$firstLanguage}/{$category}.php";
             $yiiMessages = (require "{$basePath}/../../yii/framework/messages/{$firstLanguage}/yii.php");
             foreach ($messagesToFileNames as $message => $fileNames) {
                 $fileNames = join(', ', $fileNames);
                 if (!in_array($message, $existingMessages) && !in_array($message, $yiiMessages)) {
                     $problems[] = "'{$message}' in {$fileNames} not in {$firstLanguage}/{$category}.php in {$moduleName} or its dependencies.";
                 } elseif (in_array($message, $existingMessages) && in_array($message, $yiiMessages)) {
                     $problems[] = "'{$message}' in {$fileNames} in {$firstLanguage}/{$category}.php in {$moduleName} or its dependencies is a duplicate of definition already in Yii.";
                 }
             }
         }
     } else {
         $problems[] = 'No languages were found in the following directory:' . $messagesDirectoryName . "\n";
     }
     return $problems;
 }
Пример #19
0
 public function postMessage($data, $fromUid)
 {
     $fromUid = intval($fromUid);
     $data["touid"] = is_array($data["touid"]) ? $data["touid"] : explode(",", $data["touid"]);
     $data["users"] = array_filter(array_merge(array($fromUid), $data["touid"]));
     $data["mtime"] = time();
     if (false == ($data["listid"] = $this->addMessageList($data, $fromUid))) {
         $this->addError("message", Ibos::lang("private message send fail", "message.default"));
         return false;
     }
     if (false === $this->addMessageUser($data, $fromUid)) {
         $this->addError("message", Ibos::lang("private message send fail", "message.default"));
         return false;
     }
     if (false == $this->addMessage($data, $fromUid)) {
         $this->addError("message", Ibos::lang("private message send fail", "message.default"));
         return false;
     }
     $author = User::model()->fetchByUid($fromUid);
     $config["name"] = $author["realname"];
     $config["content"] = $data["content"];
     $config["ctime"] = date("Y-m-d H:i:s", $data["mtime"]);
     $config["source_url"] = Ibos::app()->urlManager->createUrl("message/pm/index");
     MessageUtil::push("pm", $data["touid"], $data["content"]);
     MessageUtil::appPush($data["touid"], $data["content"]);
     return $data["listid"];
 }