Ejemplo n.º 1
0
                case 'NO':
                   $body .= $translator->getMessage('USER_GET_MAIL_STATUS_NO');
                   break;
                default:
                   $body .= $translator->getMessage('COMMON_MESSAGETAG_ERROR')." context_detail(244) ";
                   break;
             }

             $body .= LF.LF;
             if (!empty($_POST['description_user'])) {
                $body .= $translator->getMessage('MAIL_COMMENT_BY',$user_item->getFullname(),$_POST['description_user']);
                $body .= LF.LF;
             }
             $body .= $translator->getMessage('MAIL_SEND_TO',$recipients);
             $body .= LF;
             if ( cs_strtoupper($check_message) == 'YES') {
                $body .= $translator->getMessage('MAIL_USER_FREE_LINK').LF;
                $body .= 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?cid='.$current_item_id.'&mod=account&fct=index'.'&selstatus=1';
             } else {
                $body .= 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?cid='.$current_item_id;
             }
             $mail = new cs_mail();
             $mail->set_to(implode(',',$email_addresses));
             $server_item = $environment->getServerItem();
             $default_sender_address = $server_item->getDefaultSenderAddress();
             if (!empty($default_sender_address)) {
                $mail->set_from_email($default_sender_address);
             } else {
                $mail->set_from_email('@');
             }
             $current_context = $environment->getCurrentContextItem();
Ejemplo n.º 2
0
 /** get _getRubricNameArticle - INTERNAL
  * this method gets the rubric article
  *
  * @param string rubric
  * @param string def or undef
  * @param string postion
  * @param string first letter BIG or not
  *
  * @return array value name cases
  */
 function _getRubricNameArticle($rubric, $mode, $position, $upper_case)
 {
     // default article arrays
     $cs_article['DE']['DEF']['M']['NOMS'] = 'der';
     $cs_article['DE']['DEF']['M']['GENS'] = 'des';
     $cs_article['DE']['DEF']['M']['AKKS'] = 'den';
     $cs_article['DE']['DEF']['M']['DATS'] = 'dem';
     $cs_article['DE']['DEF']['M']['NOMPL'] = 'die';
     $cs_article['DE']['DEF']['M']['GENPL'] = 'der';
     $cs_article['DE']['DEF']['M']['AKKPL'] = 'die';
     $cs_article['DE']['DEF']['M']['DATPL'] = 'den';
     $cs_article['DE']['DEF']['F']['NOMS'] = 'die';
     $cs_article['DE']['DEF']['F']['GENS'] = 'der';
     $cs_article['DE']['DEF']['F']['AKKS'] = 'die';
     $cs_article['DE']['DEF']['F']['DATS'] = 'der';
     $cs_article['DE']['DEF']['F']['NOMPL'] = 'die';
     $cs_article['DE']['DEF']['F']['GENPL'] = 'der';
     $cs_article['DE']['DEF']['F']['AKKPL'] = 'die';
     $cs_article['DE']['DEF']['F']['DATPL'] = 'den';
     $cs_article['DE']['DEF']['N']['NOMS'] = 'das';
     $cs_article['DE']['DEF']['N']['GENS'] = 'des';
     $cs_article['DE']['DEF']['N']['AKKS'] = 'das';
     $cs_article['DE']['DEF']['N']['DATS'] = 'dem';
     $cs_article['DE']['DEF']['N']['NOMPL'] = 'die';
     $cs_article['DE']['DEF']['N']['GENPL'] = 'der';
     $cs_article['DE']['DEF']['N']['AKKPL'] = 'die';
     $cs_article['DE']['DEF']['N']['DATPL'] = 'den';
     $cs_article['DE']['UNDEF']['M']['NOMS'] = 'ein';
     $cs_article['DE']['UNDEF']['M']['GENS'] = 'eines';
     $cs_article['DE']['UNDEF']['M']['AKKS'] = 'einen';
     $cs_article['DE']['UNDEF']['M']['DATS'] = 'einem';
     $cs_article['DE']['UNDEF']['F']['NOMS'] = 'eine';
     $cs_article['DE']['UNDEF']['F']['GENS'] = 'einer';
     $cs_article['DE']['UNDEF']['F']['AKKS'] = 'eine';
     $cs_article['DE']['UNDEF']['F']['DATS'] = 'einer';
     $cs_article['DE']['UNDEF']['N']['NOMS'] = 'ein';
     $cs_article['DE']['UNDEF']['N']['GENS'] = 'eines';
     $cs_article['DE']['UNDEF']['N']['AKKS'] = 'ein';
     $cs_article['DE']['UNDEF']['N']['DATS'] = 'einem';
     $cs_article['EN'] = 'the';
     $rubric_array = $this->_getRubricArray($rubric);
     $language = cs_strtoupper($this->_selected_language);
     if ($this->_issetSessionLanguage()) {
         $language = cs_strtoupper($this->_getSessionLanguage());
     } else {
         $language = cs_strtoupper($this->_selected_language);
     }
     if ($language == 'EN') {
         $text = $cs_article[$language];
     } else {
         $text = $cs_article[$language][$mode][$rubric_array[$language]['GENUS']][cs_strtoupper($position)];
     }
     if ($upper_case == 'BIG') {
         include_once 'functions/text_functions.php';
         $text = cs_ucfirst($text);
     }
     return $text;
 }
Ejemplo n.º 3
0
 /** set search limit
  * this method sets a search limit for step
  *
  * @param string limit search limit for step
  */
 function setSearchLimit($limit)
 {
     $this->_search_limit = addcslashes(encode(AS_DB, (string) $limit), "%");
     $this->_search_limit = cs_strtoupper($this->_search_limit);
 }
Ejemplo n.º 4
0
 public function getAGBFromRoom($context_id, $language)
 {
     $result = '';
     $context_id = $this->_encode_input($context_id);
     $language = $this->_encode_input($language);
     if (!empty($context_id)) {
         $room_manager = $this->_environment->getRoomManager();
         $room_item = $room_manager->getItem($context_id);
         unset($room_manager);
         if (!empty($room_item)) {
             if ($room_item->withAGB()) {
                 $agb_text_array = $room_item->getAGBTextArray();
                 $language_array = array_keys($agb_text_array);
                 if (!in_array($language, $language_array) and !in_array(mb_strtoupper($language, 'UTF-8'), $language_array) and !in_array(mb_strtolower($language, 'UTF-8'), $language_array)) {
                     $language = 'de';
                 }
                 include_once 'functions/text_functions.php';
                 $result = $agb_text_array[cs_strtoupper($language)];
             } else {
                 $result = new SoapFault('ERROR: getAGBFromRoom', 'agbs in room (' . $context_id . ') are switched off.');
             }
         } else {
             $result = new SoapFault('ERROR: getAGBFromRoom', 'Context-ID (' . $context_id . ') not valid!');
         }
     } else {
         $result = new SoapFault('ERROR: getAGBFromRoom', 'context_id is empty!');
     }
     return $result;
 }
Ejemplo n.º 5
0
 function _getSubItemAsHTML($item, $anchor_number)
 {
     $html = '';
     $formal_data = array();
     $temp_array = array();
     $temp_array[] = $this->_translator->getMessage('COMMON_ACCOUNT');
     $temp_array[] = $item->getUserID();
     $formal_data[] = $temp_array;
     unset($temp_array);
     $portal_item = $this->_environment->getCurrentPortalItem();
     if ($portal_item->getCountAuthSourceListEnabled() != 1) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('USER_AUTH_SOURCE');
         $auth_source_item = $portal_item->getAuthSource($item->getAuthSource());
         $temp_array[] = $auth_source_item->getTitle();
         $formal_data[] = $temp_array;
         unset($temp_array);
     }
     if (!$this->_environment->inPrivateRoom()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('COMMON_STATUS');
         $current_context = $this->_environment->getCurrentContextItem();
         $status = $this->_getStatus($item, $current_context);
         $temp_array[] = $status;
         $formal_data[] = $temp_array;
         if ($item->isContact()) {
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('ROOM_CONTACT_SINGULAR');
             $temp_array[] = $this->_translator->getMessage('COMMON_YES');
             $formal_data[] = $temp_array;
         } elseif ($item->isModerator()) {
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('ROOM_CONTACT_SINGULAR');
             $temp_array[] = $this->_translator->getMessage('COMMON_NO');
             $formal_data[] = $temp_array;
         }
     }
     $current_context = $this->_environment->getCurrentContextItem();
     $language = $current_context->getLanguage();
     if (mb_strtoupper($language, 'UTF-8') == 'USER' or $this->_display_mod == 'admin' and $this->_environment->inPortal()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('USER_LANGUAGE');
         switch (cs_strtoupper($item->getLanguage())) {
             case 'BROWSER':
                 $temp_array[] = $this->_translator->getMessage('BROWSER');
                 break;
             default:
                 $temp_array[] = $this->_translator->getLanguageLabelTranslated($item->getLanguage());
                 break;
         }
         $formal_data[] = $temp_array;
     }
     if ($this->_environment->inCommunityRoom()) {
         $current_context = $this->_environment->getCurrentContextItem();
         if ($current_context->isOpenForGuests()) {
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('ACCOUNT_VISIBLE_PROPERTY');
             if ($item->isVisibleForAll()) {
                 $temp_array[] = $this->_translator->getMessage('VISIBLE_ALWAYS');
             } else {
                 $temp_array[] = $this->_translator->getMessage('VISIBLE_ONLY_LOGGED');
             }
             $formal_data[] = $temp_array;
         }
         unset($current_context);
     }
     if ($item->isModerator() or $item->isUser()) {
         // Datenschutz expired password date
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('USER_LOGIN_AS_ACTIV');
         if (!$item->isDeactivatedLoginAsAnotherUser()) {
             $temp_array[] = $this->_translator->getMessage('COMMON_YES');
         } else {
             if ($item->isTemporaryAllowedToLoginAs()) {
                 $temp_array[] = $item->getTimestampForLoginAs();
             } else {
                 $temp_array[] = $this->_translator->getMessage('COMMON_NO');
             }
         }
         $formal_data[] = $temp_array;
         if ($portal_item->getPasswordExpiration() != 0) {
             // Datenschutz expired password date
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('USER_EXPIRED_PASSWORD');
             if ($item->isPasswordExpired()) {
                 $temp_array[] = $this->_translator->getMessage('COMMON_YES');
             } else {
                 $temp_array[] = $this->_translator->getMessage('COMMON_NO');
             }
             $formal_data[] = $temp_array;
         }
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('USER_ACCEPTED_AGB');
         $agb = $item->getAGBAcceptanceDate();
         if (!empty($agb)) {
             $temp_array[] = getDateTimeInLang($item->getAGBAcceptanceDate());
         }
         $formal_data[] = $temp_array;
     }
     $temp_array = array();
     $temp_array[] = $this->_translator->getMessage('USER_EMAIL_DEFAULT');
     if (!$item->getDefaultIsMailVisible()) {
         $temp_array[] = $this->_translator->getMessage('COMMON_YES');
     } else {
         $temp_array[] = $this->_translator->getMessage('COMMON_NO');
     }
     $formal_data[] = $temp_array;
     if ($item->isModerator() and !$this->_environment->inPrivateRoom()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('ACCOUNT_EMAIL_MEMBERSHIP');
         $tempExtra = cs_strtoupper($item->getAccountWantMail());
         // text_functions, respectively cs_user_item.php
         switch ($tempExtra) {
             case 'YES':
                 $temp_array[] = $this->_translator->getMessage('COMMON_YES');
                 break;
             case 'NO':
                 $temp_array[] = $this->_translator->getMessage('COMMON_NO');
                 break;
             default:
                 $temp_array[] = $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR') . " cs_user_detail_view(362) ";
                 break;
         }
         $formal_data[] = $temp_array;
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('USER_MAIL_ROOM');
         $tempExtra = cs_strtoupper($item->getOpenRoomWantMail());
         switch ($tempExtra) {
             case 'YES':
                 $temp_array[] = $this->_translator->getMessage('COMMON_YES');
                 break;
             case 'NO':
                 $temp_array[] = $this->_translator->getMessage('COMMON_NO');
                 break;
             default:
                 $temp_array[] = $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR') . " cs_user_detail_view(362) ";
                 break;
         }
         $formal_data[] = $temp_array;
         if ($this->_environment->inCommunityRoom()) {
             $current_context = $this->_environment->getCurrentContextItem();
             if ($current_context->isOpenForGuests()) {
                 $temp_array = array();
                 $temp_array[] = $this->_translator->getMessage('ACCOUNT_EMAIL_MATERIAL');
                 $tempExtra = cs_strtoupper($item->getPublishMaterialWantMail());
                 switch ($tempExtra) {
                     case 'YES':
                         $temp_array[] = $this->_translator->getMessage('COMMON_YES');
                         break;
                     case 'NO':
                         $temp_array[] = $this->_translator->getMessage('COMMON_NO');
                         break;
                     default:
                         $temp_array[] = $this->_translator->getMessage('COMMON_MESSAGETAG_ERROR') . " cs_user_detail_view(411) ";
                         break;
                 }
                 $formal_data[] = $temp_array;
             }
             unset($current_context);
         }
     }
     if ($this->_environment->inPortal()) {
         $related_user_array = array();
         $related_user_list = $item->getRelatedUserList();
         if ($related_user_list->isNotEmpty()) {
             $user_item = $related_user_list->getFirst();
             while ($user_item) {
                 $related_user_array[$user_item->getContextID()] = $user_item;
                 unset($user_item);
                 $user_item = $related_user_list->getNext();
             }
             unset($related_user_list);
         }
         // archive
         if (!$this->_environment->isArchiveMode()) {
             $this->_environment->activateArchiveMode();
             $related_user_list = $item->getRelatedUserList();
             if ($related_user_list->isNotEmpty()) {
                 $user_item = $related_user_list->getFirst();
                 while ($user_item) {
                     $related_user_array[$user_item->getContextID()] = $user_item;
                     unset($user_item);
                     $user_item = $related_user_list->getNext();
                 }
                 unset($related_user_list);
             }
             $this->_environment->deactivateArchiveMode();
         }
         // archive - end
         $temp_array = array();
         $formal_data[] = $temp_array;
         unset($temp_array);
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('USER_ROOM_MEMBERSHIPS');
         $formal_data[] = $temp_array;
         unset($temp_array);
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('COMMUNITYS');
         $community_list = $item->getRelatedCommunityList();
         if ($community_list->isNotEmpty()) {
             $community_item = $community_list->getFirst();
             $first = true;
             $temp_string = '';
             while ($community_item) {
                 if ($first) {
                     $first = false;
                 } else {
                     $temp_string .= BRLF;
                 }
                 $temp_string .= $community_item->getTitle();
                 // status
                 $status = $this->_getStatus($related_user_array[$community_item->getItemID()], $community_item);
                 if (!empty($status)) {
                     $temp_string .= ' (' . $status . ')';
                 }
                 unset($community_item);
                 $community_item = $community_list->getNext();
             }
             $temp_array[] = $temp_string;
             unset($temp_string);
             unset($community_list);
         } else {
             $temp_array[] = '<span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span>';
         }
         $formal_data[] = $temp_array;
         unset($temp_array);
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('PROJECTS');
         $room_list = $item->getRelatedProjectList();
         if ($room_list->isNotEmpty()) {
             $room_item = $room_list->getFirst();
             $first = true;
             $temp_string = '';
             while ($room_item) {
                 if ($first) {
                     $first = false;
                 } else {
                     $temp_string .= BRLF;
                 }
                 $temp_string .= $room_item->getTitle();
                 // room status
                 if ($room_item->isLocked()) {
                     $temp_string .= ' [' . $this->_translator->getMessage('PROJECTROOM_LOCKED') . ']' . LF;
                 } elseif ($room_item->isClosed()) {
                     $temp_string .= ' [' . $this->_translator->getMessage('PROJECTROOM_CLOSED') . ']' . LF;
                 }
                 // status
                 $status = $this->_getStatus($related_user_array[$room_item->getItemID()], $room_item);
                 if (!empty($status)) {
                     $temp_string .= ' (' . $status . ')';
                 }
                 unset($room_item);
                 $room_item = $room_list->getNext();
             }
             $temp_array[] = $temp_string;
             unset($temp_string);
             unset($room_list);
         } else {
             $temp_array[] = '<span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span>';
         }
         $formal_data[] = $temp_array;
         unset($temp_array);
         // archive
         if (!$this->_environment->isArchiveMode()) {
             $temp_array = array();
             $formal_data[] = $temp_array;
             unset($temp_array);
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('PORTAL_ARCHIVED_ROOMS');
             $zzz_project_manager = $this->_environment->getZzzProjectManager();
             $zzz_project_manager->setUserIDLimit($item->getUserID());
             $zzz_project_manager->setStatusLimit(2);
             $zzz_project_manager->select();
             $archived_room_list = $zzz_project_manager->get();
             if ($archived_room_list->isNotEmpty()) {
                 $room_item = $archived_room_list->getFirst();
                 $first = true;
                 $temp_string = '';
                 while ($room_item) {
                     if ($first) {
                         $first = false;
                     } else {
                         $temp_string .= BRLF;
                     }
                     $temp_string .= $room_item->getTitle();
                     // room status
                     if ($room_item->isLocked()) {
                         $temp_string .= ' [' . $this->_translator->getMessage('PROJECTROOM_LOCKED') . ']' . LF;
                     } elseif ($room_item->isClosed()) {
                         $temp_string .= ' [' . $this->_translator->getMessage('PROJECTROOM_CLOSED') . ']' . LF;
                     }
                     // status
                     $status = $this->_getStatus($related_user_array[$room_item->getItemID()], $room_item);
                     if (!empty($status)) {
                         $temp_string .= ' (' . $status . ')';
                     }
                     unset($room_item);
                     $room_item = $archived_room_list->getNext();
                 }
                 $temp_array[] = $temp_string;
                 unset($temp_string);
                 unset($room_list);
             } else {
                 $temp_array[] = '<span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span>';
             }
             $formal_data[] = $temp_array;
             unset($temp_array);
             $this->_environment->activateArchiveMode();
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('COMMUNITYS');
             $community_list = $item->getRelatedCommunityList();
             if ($community_list->isNotEmpty()) {
                 $community_item = $community_list->getFirst();
                 $first = true;
                 $temp_string = '';
                 while ($community_item) {
                     if ($first) {
                         $first = false;
                     } else {
                         $temp_string .= BRLF;
                     }
                     $temp_string .= $community_item->getTitle();
                     // status
                     $status = $this->_getStatus($related_user_array[$community_item->getItemID()], $community_item);
                     if (!empty($status)) {
                         $temp_string .= ' (' . $status . ')';
                     }
                     unset($community_item);
                     $community_item = $community_list->getNext();
                 }
                 $temp_array[] = $temp_string;
                 unset($temp_string);
                 unset($community_list);
             } else {
                 $temp_array[] = '<span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span>';
             }
             $formal_data[] = $temp_array;
             unset($temp_array);
             $temp_array = array();
             $temp_array[] = $this->_translator->getMessage('PROJECTS');
             $room_list = $item->getRelatedProjectList();
             if ($room_list->isNotEmpty()) {
                 $room_item = $room_list->getFirst();
                 $first = true;
                 $temp_string = '';
                 while ($room_item) {
                     if ($first) {
                         $first = false;
                     } else {
                         $temp_string .= BRLF;
                     }
                     $temp_string .= $room_item->getTitle();
                     // status
                     $status = $this->_getStatus($related_user_array[$room_item->getItemID()], $room_item);
                     if (!empty($status)) {
                         $temp_string .= ' (' . $status . ')';
                     }
                     unset($room_item);
                     $room_item = $room_list->getNext();
                 }
                 $temp_array[] = $temp_string;
                 unset($temp_string);
                 unset($room_list);
             } else {
                 $temp_array[] = '<span class="disabled">' . $this->_translator->getMessage('COMMON_NONE') . '</span>';
             }
             $formal_data[] = $temp_array;
             unset($temp_array);
             $this->_environment->deactivateArchiveMode();
         }
         // arcive - end
         unset($related_user_list);
     }
     if ($this->_environment->inPrivateRoom()) {
         $temp_array = array();
         $temp_array[] = $this->_translator->getMessage('CONFIGURATION_AUTOSAVE_STATUS');
         if ($item->isAutoSaveOn()) {
             $temp_array[] = $this->_translator->getMessage('COMMON_YES');
         } else {
             $temp_array[] = $this->_translator->getMessage('COMMON_NO');
         }
         $formal_data[] = $temp_array;
     }
     if (count($formal_data) > 0) {
         $html .= $this->_getFormalDataAsHTML($formal_data) . LF;
     } else {
         $html .= '<span class="disabled">' . $this->_translator->getMessage('USER_PREFERENCES_NO_ENTRIES') . '</span>' . LF;
     }
     unset($formal_data);
     return $html;
 }
 function getInfoForHeaderAsHTML()
 {
     $retour = '';
     $retour .= '         function disable_code() {' . LF;
     $retour .= '            document.edit.code.disabled = true;' . LF;
     $retour .= '         }' . LF;
     $retour .= '         function enable_code() {' . LF;
     $retour .= '            document.edit.code.disabled = false;' . LF;
     $retour .= '         }' . LF;
     $retour .= '         function cs_toggle() {' . LF;
     $retour .= '            if (document.edit.agb_status[0].checked == true) {' . LF;
     $retour .= '               cs_enable();' . LF;
     $retour .= '            } else {' . LF;
     $retour .= '               cs_disable();' . LF;
     $retour .= '            }' . LF;
     $retour .= '         }' . LF;
     $retour .= '         function cs_disable() {' . LF;
     $retour .= '            document.edit.description_text.disabled = true;' . LF;
     foreach ($this->_languages as $language) {
         $retour .= '            document.edit.agb_text_' . cs_strtoupper($language) . '.disabled = true;' . LF;
     }
     $retour .= '         }' . LF;
     $retour .= '         function cs_enable() {' . LF;
     $retour .= '            document.edit.description_text.disabled = false;' . LF;
     foreach ($this->_languages as $language) {
         $retour .= '            document.edit.agb_text_' . cs_strtoupper($language) . '.disabled = false;' . LF;
     }
     $retour .= '         }' . LF;
     return $retour;
 }
Ejemplo n.º 7
0
 /** get RubricArray
  * this method gets the Rubric Name
  *
  * @return array value name cases
  */
 function _getRubricArray($rubric)
 {
     $commsy_context = $this->getRoomContext();
     $retour = array();
     if ($this->_issetExtra('RUBRIC_TRANSLATION_ARRAY')) {
         $rubric_translation_array = $this->_getExtra('RUBRIC_TRANSLATION_ARRAY');
         if (!empty($rubric_translation_array[cs_strtoupper($rubric)])) {
             $retour = $rubric_translation_array[cs_strtoupper($rubric)];
         }
     }
     if (empty($retour)) {
         if ($rubric == CS_PROJECT_TYPE) {
             $retour['NAME'] = CS_PROJECT_TYPE;
             $retour['DE']['GENUS'] = 'M';
             $retour['DE']['NOMS'] = 'Projektraum';
             $retour['DE']['GENS'] = 'Projektraums';
             $retour['DE']['AKKS'] = 'Projektraum';
             $retour['DE']['DATS'] = 'Projektraum';
             $retour['DE']['NOMPL'] = 'Projekträume';
             $retour['DE']['GENPL'] = 'Projekträume';
             $retour['DE']['AKKPL'] = 'Projekträume';
             $retour['DE']['DATPL'] = 'Projekträumen';
             $retour['EN']['GENUS'] = 'M';
             $retour['EN']['NOMS'] = 'project workspace';
             $retour['EN']['GENS'] = 'project workspace';
             $retour['EN']['AKKS'] = 'project workspace';
             $retour['EN']['DATS'] = 'project workspace';
             $retour['EN']['NOMPL'] = 'project workspaces';
             $retour['EN']['GENPL'] = 'project workspaces';
             $retour['EN']['AKKPL'] = 'project workspaces';
             $retour['EN']['DATPL'] = 'project workspaces';
             $retour['RU']['GENUS'] = 'F';
             $retour['RU']['NOMS'] = 'sala de proiecte';
             $retour['RU']['GENS'] = 'salii de proiecte';
             $retour['RU']['AKKS'] = 'sala de proiecte';
             $retour['RU']['DATS'] = 'salii de proiecte';
             $retour['RU']['NOMPL'] = 'salile de proiecte';
             $retour['RU']['GENPL'] = 'salilor de proiecte';
             $retour['RU']['AKKPL'] = 'salile de proiecte';
             $retour['RU']['DATPL'] = 'salilor de proiecte';
         } elseif ($rubric == CS_COMMUNITY_TYPE) {
             $retour['NAME'] = CS_COMMUNITY_TYPE;
             $retour['DE']['GENUS'] = 'M';
             $retour['DE']['NOMS'] = 'Gemeinschaftsraum';
             $retour['DE']['GENS'] = 'Gemeinschaftsraums';
             $retour['DE']['AKKS'] = 'Gemeinschaftsraum';
             $retour['DE']['DATS'] = 'Gemeinschaftsraum';
             $retour['DE']['NOMPL'] = 'Gemeinschaftsräume';
             $retour['DE']['GENPL'] = 'Gemeinschaftsräume';
             $retour['DE']['AKKPL'] = 'Gemeinschaftsräume';
             $retour['DE']['DATPL'] = 'Gemeinschaftsräumen';
             $retour['EN']['GENUS'] = 'M';
             $retour['EN']['NOMS'] = 'community workspace';
             $retour['EN']['GENS'] = 'community workspace';
             $retour['EN']['AKKS'] = 'community workspace';
             $retour['EN']['DATS'] = 'community workspace';
             $retour['EN']['NOMPL'] = 'community workspaces';
             $retour['EN']['GENPL'] = 'community workspaces';
             $retour['EN']['AKKPL'] = 'community workspaces';
             $retour['EN']['DATPL'] = 'community workspaces';
             $retour['RU']['GENUS'] = 'F';
             $retour['RU']['NOMS'] = 'sala comunitara';
             $retour['RU']['GENS'] = 'salii comunitare';
             $retour['RU']['AKKS'] = 'sala comunitara';
             $retour['RU']['DATS'] = 'salii comunitare';
             $retour['RU']['NOMPL'] = 'salile comunitare';
             $retour['RU']['GENPL'] = 'salilor comunitare';
             $retour['RU']['AKKPL'] = 'salile comunitare';
             $retour['RU']['DATPL'] = 'salilor comunitare';
         } elseif ($rubric == CS_TOPIC_TYPE) {
             $retour['NAME'] = CS_TOPIC_TYPE;
             $retour['DE']['GENUS'] = 'N';
             $retour['DE']['NOMS'] = 'Thema';
             $retour['DE']['GENS'] = 'Themas';
             $retour['DE']['AKKS'] = 'Thema';
             $retour['DE']['DATS'] = 'Thema';
             $retour['DE']['NOMPL'] = 'Themen';
             $retour['DE']['GENPL'] = 'Themen';
             $retour['DE']['AKKPL'] = 'Themen';
             $retour['DE']['DATPL'] = 'Themen';
             $retour['EN']['GENUS'] = 'N';
             $retour['EN']['NOMS'] = 'topic';
             $retour['EN']['GENS'] = 'topic';
             $retour['EN']['AKKS'] = 'topic';
             $retour['EN']['DATS'] = 'topic';
             $retour['EN']['NOMPL'] = 'topics';
             $retour['EN']['GENPL'] = 'topics';
             $retour['EN']['AKKPL'] = 'topics';
             $retour['EN']['DATPL'] = 'topics';
             $retour['RU']['GENUS'] = 'F';
             $retour['RU']['NOMS'] = 'tema';
             $retour['RU']['GENS'] = 'temei';
             $retour['RU']['AKKS'] = 'tema';
             $retour['RU']['DATS'] = 'temei';
             $retour['RU']['NOMPL'] = 'temele';
             $retour['RU']['GENPL'] = 'temelor';
             $retour['RU']['AKKPL'] = 'temele';
             $retour['RU']['DATPL'] = 'temelor';
         } elseif ($rubric == CS_INSTITUTION_TYPE) {
             $retour['NAME'] = CS_INSTITUTION_TYPE;
             $retour['DE']['GENUS'] = 'F';
             $retour['DE']['NOMS'] = 'Institution';
             $retour['DE']['GENS'] = 'Institution';
             $retour['DE']['AKKS'] = 'Institution';
             $retour['DE']['DATS'] = 'Institution';
             $retour['DE']['NOMPL'] = 'Institutionen';
             $retour['DE']['GENPL'] = 'Institutionen';
             $retour['DE']['AKKPL'] = 'Institutionen';
             $retour['DE']['DATPL'] = 'Institutionen';
             $retour['EN']['GENUS'] = 'F';
             $retour['EN']['NOMS'] = 'institution';
             $retour['EN']['GENS'] = 'institution';
             $retour['EN']['AKKS'] = 'institution';
             $retour['EN']['DATS'] = 'institution';
             $retour['EN']['NOMPL'] = 'institutions';
             $retour['EN']['GENPL'] = 'institutions';
             $retour['EN']['AKKPL'] = 'institutions';
             $retour['EN']['DATPL'] = 'institutions';
             $retour['RU']['GENUS'] = 'F';
             $retour['RU']['NOMS'] = 'institutia';
             $retour['RU']['GENS'] = 'institutiei';
             $retour['RU']['AKKS'] = 'institutia';
             $retour['RU']['DATS'] = 'institutiei';
             $retour['RU']['NOMPL'] = 'institutiile';
             $retour['RU']['GENPL'] = 'institutiilor';
             $retour['RU']['AKKPL'] = 'institutiile';
             $retour['RU']['DATPL'] = 'institutiilor';
         } else {
             $retour['NAME'] = 'rubrics';
             $retour['DE']['GENUS'] = 'F';
             $retour['DE']['NOMS'] = 'Rubrik';
             $retour['DE']['GENS'] = 'Rubrik';
             $retour['DE']['AKKS'] = 'Rubrik';
             $retour['DE']['DATS'] = 'Rubrik';
             $retour['DE']['NOMPL'] = 'Rubriken';
             $retour['DE']['GENPL'] = 'Rubriken';
             $retour['DE']['AKKPL'] = 'Rubriken';
             $retour['DE']['DATPL'] = 'Rubriken';
             $retour['EN']['GENUS'] = 'F';
             $retour['EN']['NOMS'] = 'rubric';
             $retour['EN']['GENS'] = 'rubric';
             $retour['EN']['AKKS'] = 'rubric';
             $retour['EN']['DATS'] = 'rubric';
             $retour['EN']['NOMPL'] = 'rubrics';
             $retour['EN']['GENPL'] = 'rubrics';
             $retour['EN']['AKKPL'] = 'rubrics';
             $retour['EN']['DATPL'] = 'rubrics';
             $retour['RU']['GENUS'] = 'F';
             $retour['RU']['NOMS'] = 'rubrica';
             $retour['RU']['GENS'] = 'rubricii';
             $retour['RU']['AKKS'] = 'rubrica';
             $retour['RU']['DATS'] = 'rubricii';
             $retour['RU']['NOMPL'] = 'rubricile';
             $retour['RU']['GENPL'] = 'rubricilor';
             $retour['RU']['AKKPL'] = 'rubricile';
             $retour['RU']['DATPL'] = 'rubricilor';
         }
     }
     return $retour;
 }
Ejemplo n.º 8
0
 /** get out of service of a context
  * this method returns the out of service of the context
  *
  * @return string out of service of a context
  */
 public function getOutOfServiceByLanguage($language)
 {
     $retour = '';
     if ($language == 'browser') {
         $language = $this->_environment->getSelectedLanguage();
     }
     $desc_array = $this->getOutOfServiceArray();
     if (!empty($desc_array[cs_strtoupper($language)])) {
         $retour = $desc_array[cs_strtoupper($language)];
     }
     return $retour;
 }
Ejemplo n.º 9
0
 /** is an user_id free?
  * this method returns a boolean whether the user_id is free to choose
  * needed because of german umlauts
  *
  * @param string user_id id of the user (not item id)
  *
  * @return boolean true, if user_id is free to choose
  *                 false, if user_id is not free
  */
 function is_free($user_id, $auth_source)
 {
     // guest and root are system user_ids, the can not be created be users
     // guest is for not logged in users
     // root is for the super admin
     if (cs_strtoupper($user_id) == 'GUEST' or cs_strtoupper($user_id) == 'ROOT') {
         return false;
     }
     $auth_manager = $this->getAuthManager($auth_source);
     $this->_used_auth_manager = $auth_manager;
     return $auth_manager->is_free($user_id);
 }
Ejemplo n.º 10
0
 private function getConfigContent()
 {
     $return = array();
     $current_context = $this->_environment->getCurrentContextItem();
     $translator = $this->_environment->getTranslationObject();
     // user id
     $return['user_id'] = $this->_item->getUserID();
     // portal
     $portal_item = $this->_environment->getCurrentPortalItem();
     if ($portal_item->getCountAuthSourceListEnabled() !== 1) {
         $return['auth_source'] = $portal_item->getAuthSource($this->_item->getAuthSource())->getTitle();
     }
     if (!$this->_environment->inPrivateRoom()) {
         // status
         $status = '';
         if ($this->_item->isModerator()) {
             $status = $translator->getMessage('USER_STATUS_MODERATOR');
         } elseif ($this->_item->isUser()) {
             $status = $translator->getMessage('USER_STATUS_USER');
         } elseif ($this->_item->isRequested()) {
             $status = $translator->getMessage('USER_STATUS_REQUESTED');
         } else {
             if (!$current_context->isCommunityRoom()) {
                 $status = $translator->getMessage('USER_STATUS_CLOSED');
             } else {
                 $last_login = $this->_item->getLastlogin();
                 if (!empty($last_login)) {
                     $status = $translator->getMessage('USER_STATUS_CLOSED');
                 } else {
                     $status = $translator->getMessage('USER_STATUS_REJECT');
                 }
             }
         }
         $return['status'] = $status;
         // contact
         if ($this->_item->isContact()) {
             $return['contact'] = 'common_yes';
         } elseif ($this->_item->isModerator()) {
             $return['contact'] = 'common_no';
         }
         // language
         $language = $current_context->getLanguage();
         if (mb_strtoupper($language, 'UTF-8') === 'USER' || $this->_display_mod === 'admin' && $this->_environment->inPortal()) {
             switch (cs_strtoupper($this->_item->getLanguage())) {
                 case 'BROWSER':
                     $return['language'] = 'browser';
                     break;
                 default:
                     $return['language'] = $translator->getLanguageLabelTranslated($this->_item->getLanguage());
                     break;
             }
         }
     }
     // visibility
     if ($this->_environment->inCommunityRoom()) {
         if ($current_context->isOpenForGuests()) {
             if ($this->_item->isVisibleForAll()) {
                 $return['visibility'] = 'always';
             } else {
                 $return['visibility'] = 'only_logged';
             }
         }
     }
     // mailing
     if ($this->_item->isModerator() && !$this->_environment->inPrivateRoom()) {
         $temp_extra = cs_strtoupper($this->_item->getAccountWantMail());
         // text_functions, respectively cs_user_item.php
         switch ($temp_extra) {
             case 'YES':
                 $return['mailing'] = 'yes';
                 break;
             case 'NO':
                 $return['mailing'] = 'no';
                 break;
             default:
                 $return['mailing'] = 'error';
                 break;
         }
         $temp_extra = cs_strtoupper($this->_item->getOpenRoomWantMail());
         switch ($temp_extra) {
             case 'YES':
                 $return['mailing_room'] = 'yes';
                 break;
             case 'NO':
                 $return['mailing_room'] = 'no';
                 break;
             default:
                 $return['mailing_room'] = 'error';
                 break;
         }
         $temp_extra = cs_strtoupper($this->_item->getDeleteEntryWantMail());
         switch ($temp_extra) {
             case 'YES':
                 $return['mailing_delete_entries'] = 'yes';
                 break;
             case 'NO':
                 $return['mailing_delete_entries'] = 'no';
                 break;
             default:
                 $return['mailing_delete_entries'] = 'error';
                 break;
         }
         if ($this->_environment->inCommunityRoom()) {
             if ($current_context->isOpenForGuests()) {
                 $temp_extra = cs_strtoupper($this->_item->getPublishMaterialWantMail());
                 switch ($temp_extra) {
                     case 'YES':
                         $return['mailing_material'] = 'yes';
                         break;
                     case 'NO':
                         $return['mailing_material'] = 'no';
                         break;
                     default:
                         $return['mailing_material'] = 'error';
                         break;
                 }
             }
         }
     }
     if ($this->_environment->inPortal()) {
         $related_user_array = array();
         $Related_user_list = $this->_item->getRelatedUserList();
         if ($related_user_list->isNotEmpty()) {
             $user_item = $related_user_list->getFirst();
             while ($user_item) {
                 $related_user_array[$user_item->getContextID()] = $user_item;
                 $user_item = $related_user_list->getNext();
             }
             unset($related_user_list);
         }
         // TODO: migrate
         /*
         *
         
                $temp_array = array();
                $formal_data[] = $temp_array;
                unset($temp_array);
         
                $temp_array = array();
                $temp_array[] = $this->_translator->getMessage('USER_ROOM_MEMBERSHIPS');
                $formal_data[] = $temp_array;
                unset($temp_array);
         
                $temp_array = array();
                $temp_array[] = $this->_translator->getMessage('COMMUNITYS');
         
                $community_list = $item->getRelatedCommunityList();
                if ($community_list->isNotEmpty()) {
                   $community_item = $community_list->getFirst();
                   $first = true;
                   $temp_string = '';
                   while ($community_item) {
                     if ($first) {
                        $first = false;
                     } else {
                        $temp_string .= BRLF;
                     }
                     $temp_string .= $community_item->getTitle();
         
                     // status
                         $status = $this->_getStatus($related_user_array[$community_item->getItemID()],$community_item);
                     if (!empty($status)) {
                        $temp_string .= ' ('.$status.')';
                     }
                     unset($community_item);
                     $community_item = $community_list->getNext();
                  }
                  $temp_array[] = $temp_string;
                  unset($temp_string);
                  unset($community_list);
                } else {
                   $temp_array[] = '<span class="disabled">'.$this->_translator->getMessage('COMMON_NONE').'</span>';
                }
                $formal_data[] = $temp_array;
                unset($temp_array);
         
                $temp_array = array();
                $temp_array[] = $this->_translator->getMessage('PROJECTS');
         
                $room_list = $item->getRelatedProjectList();
                if ($room_list->isNotEmpty()) {
                   $room_item = $room_list->getFirst();
                   $first = true;
                   $temp_string = '';
                   while ($room_item) {
                     if ($first) {
                        $first = false;
                     } else {
                        $temp_string .= BRLF;
                     }
                     $temp_string .= $room_item->getTitle();
                     // room status
                         if ($room_item->isLocked()) {
                            $temp_string .= ' ['.$this->_translator->getMessage('PROJECTROOM_LOCKED').']'.LF;
                         } elseif ($room_item->isClosed()) {
                            $temp_string .= ' ['.$this->_translator->getMessage('PROJECTROOM_CLOSED').']'.LF;
                         }
                     // status
                         $status = $this->_getStatus($related_user_array[$room_item->getItemID()],$room_item);
                     if (!empty($status)) {
                        $temp_string .= ' ('.$status.')';
                     }
                     unset($room_item);
                     $room_item = $room_list->getNext();
                  }
                  $temp_array[] = $temp_string;
                  unset($temp_string);
                  unset($room_list);
                } else {
                   $temp_array[] = '<span class="disabled">'.$this->_translator->getMessage('COMMON_NONE').'</span>';
                }
                $formal_data[] = $temp_array;
                unset($temp_array);
                unset($related_user_list);
         */
     }
     if ($this->_environment->inPrivateRoom()) {
         // TODO: migrate
         /*
         * $temp_array = array();
                  $temp_array[] = $this->_translator->getMessage('CONFIGURATION_AUTOSAVE_STATUS');
                  if ( $item->isAutoSaveOn() ) {
                     $temp_array[] = $this->_translator->getMessage('COMMON_YES');
                  } else {
                     $temp_array[] = $this->_translator->getMessage('COMMON_NO');
                  }
                  $formal_data[] = $temp_array;
         */
     }
     // plugin
     include_once 'functions/misc_functions.php';
     $return['plugin_array'] = plugin_hook_output_all('getUserDetailConfigArray', array('user_item' => $this->_item), 'MULTIARRAY');
     return $return;
 }
Ejemplo n.º 11
0
 /** get description of a context
  * this method returns the description of the context
  *
  * @return string description of a context
  */
 function getDescriptionWellcome2ByLanguage($language)
 {
     $retour = NULL;
     if ($language == 'browser') {
         $language = $this->_environment->getSelectedLanguage();
     }
     $desc_array = $this->getDescriptionWellcome2Array();
     if (isset($desc_array[cs_strtoupper($language)])) {
         $retour = $desc_array[cs_strtoupper($language)];
     } else {
         $retour = '... ' . $this->getTitle();
     }
     return $retour;
 }
 /** loads the selected and given values to the form
  * this methods loads the selected and given values to the form from the material item or the form_post data
  *
  * @author CommSy Development Group
  */
 function _prepareValues()
 {
     $this->_values = array();
     if (isset($this->_item)) {
         $this->_values['iid'] = $this->_item->getItemID();
         $this->_values['title'] = $this->_item->getTitle();
         $this->_values['context'] = $this->_item->getRoomContext();
         $this->_values['show_title'] = $this->_item->showTitle();
         $this->_values['language'] = $this->_item->getLanguage();
         $this->_values['logo'] = $this->_item->getLogoFilename();
         $this->_values['logo_hidden'] = $this->_item->getLogoFilename();
         if ($this->_item->isCommunityRoom()) {
             $this->_values['template_availability'] = $this->_item->getCommunityTemplateAvailability();
         } else {
             $this->_values['template_availability'] = $this->_item->getTemplateAvailability();
         }
         if ($this->_item->isPortal()) {
             $this->_values['picture'] = $this->_item->getPictureFilename();
             $this->_values['picture_hidden'] = $this->_item->getPictureFilename();
             $url = $this->_item->getURL();
             if (isset($url)) {
                 $this->_values['url'] = $url;
             }
             unset($url);
         }
         if ($this->_item->isCommunityRoom()) {
             if ($this->_item->isTemplate()) {
                 $this->_values['template'] = 1;
             }
         }
         if ($this->_item->isProjectRoom()) {
             $this->_values['public'] = $this->_item->getPublic();
             $community_room_array = array();
             $community_room_list = $this->_item->getCommunityList();
             if ($community_room_list->getCount() > 0) {
                 $community_room_item = $community_room_list->getFirst();
                 while ($community_room_item) {
                     $community_room_array[] = $community_room_item->getItemID();
                     $community_room_item = $community_room_list->getNext();
                 }
             }
             if (isset($this->_form_post['communityroomlist'])) {
                 $this->_values['communityroomlist'] = $this->_form_post['communityroomlist'];
             } else {
                 $this->_values['communityroomlist'] = $community_room_array;
             }
         }
         if ($this->_item->isServer()) {
             $this->_values['server_default_sender_address'] = $this->_item->getDefaultSenderAddress();
             $this->_values['server_portal_option'] = $this->_item->getDefaultPortalItemID();
             $url = $this->_item->getURL();
             if (isset($url)) {
                 $this->_values['url'] = $url;
             }
             unset($url);
         }
         if ($this->_item->isPortal()) {
             $description_array = $this->_item->getDescriptionWellcome1Array();
             $languages = $this->_environment->getAvailableLanguageArray();
             foreach ($languages as $language) {
                 if (isset($description_array[cs_strtoupper($language)])) {
                     $this->_values['wellcome1_' . $language] = $description_array[cs_strtoupper($language)];
                 } else {
                     $this->_values['wellcome1_' . $language] = $this->_item->getDescriptionWellcome1ByLanguage(cs_strtoupper($language));
                 }
             }
             $description_array = $this->_item->getDescriptionWellcome2Array();
             $languages = $this->_environment->getAvailableLanguageArray();
             foreach ($languages as $language) {
                 if (isset($description_array[cs_strtoupper($language)])) {
                     $this->_values['wellcome2_' . $language] = $description_array[cs_strtoupper($language)];
                 } else {
                     $this->_values['wellcome2_' . $language] = $this->_item->getDescriptionWellcome2ByLanguage(cs_strtoupper($language));
                 }
             }
             $description_array = $this->_item->getDescriptionArray();
             $languages = $this->_environment->getAvailableLanguageArray();
             foreach ($languages as $language) {
                 if (!empty($description_array[cs_strtoupper($language)])) {
                     $this->_values['description_' . $language] = $description_array[cs_strtoupper($language)];
                 } else {
                     $this->_values['description_' . $language] = '';
                 }
             }
         } else {
             $this->_values['description'] = $this->_item->getDescription();
         }
         if ($this->_item->isCommunityRoom()) {
             $this->_values['show_title'] = $this->_item->showTitle();
             if ($this->_item->showTime()) {
                 $this->_values['show_time'] = '1';
             } else {
                 $this->_values['show_time'] = '-1';
             }
         }
         if ($this->_item->checkNewMembersNever()) {
             $this->_values['member_check'] = 'never';
         } elseif ($this->_item->checkNewMembersAlways()) {
             $this->_values['member_check'] = 'always';
         } elseif ($this->_item->checkNewMembersSometimes()) {
             $this->_values['member_check'] = 'sometimes';
         } elseif ($this->_item->checkNewMembersWithCode()) {
             $this->_values['member_check'] = 'withcode';
         }
         $code = $this->_item->getCheckNewMemberCode();
         if (!empty($code)) {
             $this->_values['code'] = $code;
         }
         if ($this->_item->isOpenForGuests()) {
             $this->_values['open_for_guests'] = 'open';
         } else {
             $this->_values['open_for_guests'] = 'closed';
         }
         if ($this->_item->isAssignmentOnlyOpenForRoomMembers()) {
             $this->_values['room_assignment'] = 'closed';
         } else {
             $this->_values['room_assignment'] = 'open';
         }
         if ($this->_type == 'project' and $this->_environment->inProjectRoom()) {
             $community_list = $this->_item->getCommunityList();
             $mark_array = array();
             if ($community_list->isNotEmpty()) {
                 $community_item = $community_list->getFirst();
                 while ($community_item) {
                     $mark_array[] = $community_item->getItemID();
                     $community_item = $community_list->getNext();
                 }
                 $this->_values[CS_COMMUNITY_TYPE] = $mark_array;
                 unset($mark_array);
             }
         }
         if ($this->_type == CS_PROJECT_TYPE and $this->_environment->inProjectRoom() or $this->_type == CS_PROJECT_TYPE and $this->_environment->inCommunityRoom() or $this->_type == CS_GROUPROOM_TYPE and $this->_environment->inGroupRoom()) {
             $portal_item = $this->_environment->getCurrentPortalItem();
             if ($portal_item->showTime()) {
                 $time_list = $this->_item->getTimeList();
                 $mark_array = array();
                 if ($time_list->isNotEmpty()) {
                     $time_item = $time_list->getFirst();
                     while ($time_item) {
                         $mark_array[] = $time_item->getItemID();
                         $time_item = $time_list->getNext();
                     }
                     if ($this->_item->isContinuous()) {
                         $mark_array[] = 'cont';
                     }
                     $this->_values['time2'] = $mark_array;
                     unset($mark_array);
                 }
             }
         }
         if ($this->_type == 'project' and $this->_environment->inCommunityRoom() or ($this->_type == 'project' or $this->_type == CS_COMMUNITY_TYPE) and $this->_environment->inPrivateRoom()) {
             $this->_setValuesForRubricConnections();
         }
         // usage infos
         if ($this->_type == CS_PROJECT_TYPE or $this->_type == CS_COMMUNITY_TYPE) {
             $this->_values['usage_infos'] = $this->_item->getUsageInfoArray();
         }
         $this->_values['servicelink'] = $this->_item->isServiceLinkActive();
         // templates in private rooms
         if ($this->_item->isPrivateRoom()) {
             $this->_values['template_select'] = $this->_item->getTemplateID();
         }
     } elseif (isset($this->_form_post)) {
         $this->_values = $this->_form_post;
         if (!isset($this->_values['public'])) {
             $this->_values['public'] = '0';
         }
         if (isset($this->_values['logo_hidden']) and !empty($this->_values['logo_hidden'])) {
             $this->_values['logo'] = $this->_values['logo_hidden'];
         }
         if (isset($this->_values['picture_hidden']) and !empty($this->_values['picture_hidden'])) {
             $this->_values['picture'] = $this->_values['picture_hidden'];
         }
     } else {
         $context = $this->_environment->getCurrentContextItem();
         $this->_values['public'] = '0';
         $this->_values['context'] = $context->getRoomContext();
         if ($this->_environment->inServer()) {
             $this->_values['type'] = CS_PORTAL_TYPE;
             $this->_values['member_check'] = 'never';
         } else {
             if ($this->_environment->getCurrentModule() == CS_COMMUNITY_TYPE) {
                 $this->_values['type'] = CS_COMMUNITY_TYPE;
             } else {
                 $this->_values['type'] = CS_PROJECT_TYPE;
             }
             $this->_values['member_check'] = 'always';
         }
         $this->_values['member_check'] = 'always';
         $this->_values['show_title'] = 'yes';
         // Zuordnen des aktuellen Gemeinschatsraums in zu einem daraus neu geöffneten Raum.
         if ($this->_environment->inCommunityRoom() and $this->_environment->getCurrentModule() == CS_PROJECT_TYPE) {
             $this->_values['communityrooms'] = $this->_environment->getCurrentContextID();
         }
         $current_portal_item = $this->_environment->getCurrentPortalItem();
         if (isset($current_portal_item)) {
             if ($this->_environment->inPortal() and $this->_environment->getCurrentModule() == 'community') {
                 $this->_values['template_select'] = $this->_environment->getCurrentPortalItem()->getDefaultCommunityTemplateID();
             } else {
                 $this->_values['template_select'] = $this->_environment->getCurrentPortalItem()->getDefaultProjectTemplateID();
             }
             unset($current_portal_item);
         }
         // default language of room
         $current_user = $this->_environment->getCurrentUserItem();
         $lang = $current_user->getLanguage();
         if (empty($lang) or mb_strtoupper($lang, 'UTF-8') == 'BROWSER') {
             $lang = $this->_environment->getSelectedLanguage();
         }
         if (!empty($lang)) {
             $this->_values['language'] = mb_strtolower($lang, 'UTF-8');
         }
     }
 }
Ejemplo n.º 13
0
 /** set search limit
  * this method sets a search limit for dates
  *
  * @param string limit search limit for dates
  */
 function setSearchLimit($limit)
 {
     $limit = addcslashes(encode(AS_DB, (string) $limit), '%');
     $limit = cs_strtoupper($limit);
     //find all occurances of quoted text and store them in an array
     preg_match_all('~(\\"(.+?)\\\\")~u', $limit, $literal_array);
     //delete this occurances from the original string
     $limit = preg_replace('~(\\\\"(.+?)\\\\")~u', '', $limit);
     preg_match_all('~\\s-([\\w' . SPECIAL_CHARS . ']+)~u', $limit, $this->_search_negative_array);
     $limit = preg_replace('~\\s-([\\w' . SPECIAL_CHARS . ']+)~u', '', $limit);
     //clean up the resulting array from quots
     $literal_array = str_replace('"', '', $literal_array[2]);
     //clean up rest of $limit and get an array with entrys
     $limit = str_replace('  ', ' ', $limit);
     $limit = trim($limit);
     $split_array = explode(' ', $limit);
     //check which array contains search limits and act accordingly
     if ($split_array[0] != '' and count($literal_array) > 0) {
         $this->_search_array = array_merge($split_array, $literal_array);
     } else {
         if ($split_array[0] != '') {
             $this->_search_array = $split_array;
         } else {
             $this->_search_array = $literal_array;
         }
     }
 }
Ejemplo n.º 14
0
 /** specific check the values of the form
  * this methods check the entered values
  *
  * @author CommSy Development Group
  */
 function _checkValues()
 {
     if ($this->_form_post['agb_status'] == 1) {
         $no_language_set = true;
         foreach ($this->_languages as $language) {
             if (!empty($this->_values['agb_text_' . cs_strtoupper($language)])) {
                 $no_language_set = false;
                 break;
             }
         }
         if ($no_language_set) {
             $this->_error_array[] = $this->_translator->getMessage('CONFIGURATION_AGB_TEXT_ERROR');
             foreach ($this->_languages as $language) {
                 $this->_form->setFailure('agb_text_' . cs_strtoupper($language), '');
             }
         }
     }
 }
 public function save($form_data, $additional = array())
 {
     switch ($additional['action']) {
         case 'context_join':
             //---
             $room_manager = $this->_environment->getRoomManager();
             $room_item = $room_manager->getItem($form_data['iid']);
             $current_item_id = $form_data['iid'];
             if (empty($room_item)) {
                 $grouproom_flag = true;
                 $room_item = $room_manager->getItem($additional['context_id']);
                 $current_item_id = $additional['context_id'];
                 // label item holen und addmember ausführen wenn kein member
                 $label_manager = $this->_environment->getLabelManager();
                 $label_item = $label_manager->getItem($form_data['iid']);
             }
             $translator = $this->_environment->getTranslationObject();
             $portal_item = $this->_environment->getCurrentPortalItem();
             $agb_flag = false;
             if ($portal_item->withAGBDatasecurity()) {
                 if ($room_item->getAGBStatus() == 1) {
                     if ($form_data['agb']) {
                         $agb_flag = true;
                     } else {
                         $agb_flag = false;
                     }
                 } else {
                     $agb_flag = true;
                 }
             } else {
                 $agb_flag = true;
             }
             #pr($agb_flag);
             // build new user_item
             if ((!$room_item->checkNewMembersWithCode() or $room_item->getCheckNewMemberCode() == $form_data['code'] or $room_item->getCheckNewMemberCode() and !empty($form_data['description_user'])) and $agb_flag) {
                 $current_user = $this->_environment->getCurrentUserItem();
                 $private_room_user_item = $current_user->getRelatedPrivateRoomUserItem();
                 if (isset($private_room_user_item)) {
                     $user_item = $private_room_user_item->cloneData();
                     $picture = $private_room_user_item->getPicture();
                 } else {
                     $user_item = $current_user->cloneData();
                     $picture = $current_user->getPicture();
                 }
                 $user_item->setContextID($current_item_id);
                 if (!empty($picture)) {
                     $value_array = explode('_', $picture);
                     $value_array[0] = 'cid' . $user_item->getContextID();
                     $new_picture_name = implode('_', $value_array);
                     $disc_manager = $this->_environment->getDiscManager();
                     $disc_manager->copyImageFromRoomToRoom($picture, $user_item->getContextID());
                     $user_item->setPicture($new_picture_name);
                 }
                 if (isset($form_data['description_user'])) {
                     $user_item->setUserComment($form_data['description_user']);
                 }
                 //check room_settings
                 if (!$room_item->checkNewMembersNever() and !$room_item->checkNewMembersWithCode() or $room_item->checkNewMembersWithCode() and $room_item->getCheckNewMemberCode() != $form_data['code']) {
                     $user_item->request();
                     $check_message = 'YES';
                     // for mail body
                     $account_mode = 'info';
                 } else {
                     $user_item->makeUser();
                     // for mail body
                     $check_message = 'NO';
                     $account_mode = 'to_room';
                     // save link to the group ALL
                     $group_manager = $this->_environment->getLabelManager();
                     $group_manager->setExactNameLimit('ALL');
                     $group_manager->setContextLimit($current_item_id);
                     $group_manager->select();
                     $group_list = $group_manager->get();
                     if ($group_list->getCount() == 1) {
                         $group = $group_list->getFirst();
                         $group->setTitle('ALL');
                         $user_item->setGroupByID($group->getItemID());
                     }
                     if (isset($label_item) and !empty($label_item)) {
                         if (!$label_item->isMember($current_user)) {
                             $label_item->addMember($current_user);
                         }
                     }
                 }
                 if ($portal_item->withAGBDatasecurity()) {
                     if ($room_item->getAGBStatus()) {
                         if ($form_data['agb']) {
                             $user_item->setAGBAcceptance();
                         }
                     }
                 }
                 // test if user id already exists (reload page)
                 $user_id = $user_item->getUserID();
                 $user_test_item = $room_item->getUserByUserID($user_id, $user_item->getAuthSource());
                 if (!isset($user_test_item) and mb_strtoupper($user_id, 'UTF-8') != 'GUEST' and mb_strtoupper($user_id, 'UTF-8') != 'ROOT') {
                     $user_item->save();
                     $user_item->setCreatorID2ItemID();
                     // save task
                     if (!$room_item->checkNewMembersNever() and !$room_item->checkNewMembersWithCode()) {
                         $task_manager = $this->_environment->getTaskManager();
                         $task_item = $task_manager->getNewItem();
                         $current_user = $this->_environment->getCurrentUserItem();
                         $task_item->setCreatorItem($current_user);
                         $task_item->setContextID($room_item->getItemID());
                         $task_item->setTitle('TASK_USER_REQUEST');
                         $task_item->setStatus('REQUEST');
                         $task_item->setItem($user_item);
                         $task_item->save();
                     }
                     // send email to moderators if necessary
                     $user_manager = $this->_environment->getUserManager();
                     $user_manager->resetLimits();
                     $user_manager->setModeratorLimit();
                     $user_manager->setContextLimit($current_item_id);
                     $user_manager->select();
                     $user_list = $user_manager->get();
                     $email_addresses = array();
                     $moderator_item = $user_list->getFirst();
                     $recipients = '';
                     while ($moderator_item) {
                         $want_mail = $moderator_item->getAccountWantMail();
                         if (!empty($want_mail) and $want_mail == 'yes') {
                             $email_addresses[] = $moderator_item->getEmail();
                             $recipients .= $moderator_item->getFullname() . "\n";
                         }
                         $moderator_item = $user_list->getNext();
                     }
                     // language
                     $language = $room_item->getLanguage();
                     if ($language == 'user') {
                         $language = $user_item->getLanguage();
                         if ($language == 'browser') {
                             $language = $this->_environment->getSelectedLanguage();
                         }
                     }
                     if (count($email_addresses) > 0) {
                         $save_language = $translator->getSelectedLanguage();
                         $translator->setSelectedLanguage($language);
                         $subject = $translator->getMessage('USER_JOIN_CONTEXT_MAIL_SUBJECT', $user_item->getFullname(), $room_item->getTitle());
                         $body = $translator->getMessage('MAIL_AUTO', $translator->getDateInLang(getCurrentDateTimeInMySQL()), $translator->getTimeInLang(getCurrentDateTimeInMySQL()));
                         $body .= LF . LF;
                         // Datenschutz
                         if ($this->_environment->getCurrentPortalItem()->getHideAccountname()) {
                             $userid = 'XXX ' . $translator->getMessage('COMMON_DATASECURITY');
                         } else {
                             $userid = $user_item->getUserID();
                         }
                         $body .= $translator->getMessage('USER_JOIN_CONTEXT_MAIL_BODY', $user_item->getFullname(), $userid, $user_item->getEmail(), $room_item->getTitle());
                         $body .= LF . LF;
                         $tempMessage = "";
                         switch (cs_strtoupper($check_message)) {
                             case 'YES':
                                 $body .= $translator->getMessage('USER_GET_MAIL_STATUS_YES');
                                 break;
                             case 'NO':
                                 $body .= $translator->getMessage('USER_GET_MAIL_STATUS_NO');
                                 break;
                             default:
                                 $body .= $translator->getMessage('COMMON_MESSAGETAG_ERROR') . " context_detail(244) ";
                                 break;
                         }
                         $body .= LF . LF;
                         if (!empty($form_data['description_user'])) {
                             $body .= $translator->getMessage('MAIL_COMMENT_BY', $user_item->getFullname(), $form_data['description_user']);
                             $body .= LF . LF;
                         }
                         $body .= $translator->getMessage('MAIL_SEND_TO', $recipients);
                         $body .= LF;
                         if (cs_strtoupper($check_message) == 'YES') {
                             $body .= $translator->getMessage('MAIL_USER_FREE_LINK') . LF;
                             $body .= 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $current_item_id . '&mod=account&fct=index' . '&selstatus=1';
                         } else {
                             $body .= 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $current_item_id;
                         }
                         $mail = new cs_mail();
                         $mail->set_to(implode(',', $email_addresses));
                         $server_item = $this->_environment->getServerItem();
                         $default_sender_address = $server_item->getDefaultSenderAddress();
                         if (!empty($default_sender_address)) {
                             $mail->set_from_email($default_sender_address);
                         } else {
                             $mail->set_from_email('@');
                         }
                         $current_context = $this->_environment->getCurrentContextItem();
                         $mail->set_from_name($translator->getMessage('SYSTEM_MAIL_MESSAGE', $current_context->getTitle()));
                         $mail->set_reply_to_name($user_item->getFullname());
                         $mail->set_reply_to_email($user_item->getEmail());
                         $mail->set_subject($subject);
                         $mail->set_message($body);
                         $mail->send();
                         $translator->setSelectedLanguage($save_language);
                     }
                     // send email to user when account is free automatically (PROJECT ROOM)
                     if ($user_item->isUser()) {
                         // get contact moderator (TBD) now first moderator
                         $user_list = $room_item->getModeratorList();
                         $contact_moderator = $user_list->getFirst();
                         // change context to project room
                         $translator->setEmailTextArray($room_item->getEmailTextArray());
                         $translator->setContext('project');
                         $save_language = $translator->getSelectedLanguage();
                         // language
                         $language = $room_item->getLanguage();
                         if ($language == 'user') {
                             $language = $user_item->getLanguage();
                             if ($language == 'browser') {
                                 $language = $this->_environment->getSelectedLanguage();
                             }
                         }
                         // Datenschutz
                         if ($this->_environment->getCurrentPortalItem()->getHideAccountname()) {
                             $userid = 'XXX ' . $translator->getMessage('COMMON_DATASECURITY');
                         } else {
                             $userid = $user_item->getUserID();
                         }
                         $translator->setSelectedLanguage($language);
                         // email texts
                         $subject = $translator->getMessage('MAIL_SUBJECT_USER_STATUS_USER', $room_item->getTitle());
                         $body = $translator->getMessage('MAIL_AUTO', $translator->getDateInLang(getCurrentDateTimeInMySQL()), $translator->getTimeInLang(getCurrentDateTimeInMySQL()));
                         $body .= LF . LF;
                         $body .= $translator->getEmailMessage('MAIL_BODY_HELLO', $user_item->getFullname());
                         $body .= LF . LF;
                         $body .= $translator->getEmailMessage('MAIL_BODY_USER_STATUS_USER', $userid, $room_item->getTitle());
                         $body .= LF . LF;
                         $body .= $translator->getEmailMessage('MAIL_BODY_CIAO', $contact_moderator->getFullname(), $room_item->getTitle());
                         $body .= LF . LF;
                         $body .= 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?cid=' . $this->_environment->getCurrentContextID();
                         // send mail to user
                         $mail = new cs_mail();
                         $mail->set_to($user_item->getEmail());
                         $mail->set_from_name($translator->getMessage('SYSTEM_MAIL_MESSAGE', $room_item->getTitle()));
                         $server_item = $this->_environment->getServerItem();
                         $default_sender_address = $server_item->getDefaultSenderAddress();
                         if (!empty($default_sender_address)) {
                             $mail->set_from_email($default_sender_address);
                         } else {
                             $mail->set_from_email('@');
                         }
                         $mail->set_reply_to_email($contact_moderator->getEmail());
                         $mail->set_reply_to_name($contact_moderator->getFullname());
                         $mail->set_subject($subject);
                         $mail->set_message($body);
                         $mail->send();
                     }
                 }
             } elseif ($room_item->checkNewMembersWithCode() and $room_item->getCheckNewMemberCode() != $form_data['code']) {
                 $account_mode = 'member';
                 $error = 'code';
                 $this->_popup_controller->setErrorReturn(111, 'wrong_code', array());
             } elseif (!$agb_flag and $portal_item->withAGBDatasecurity() and $room_item->getAGBStatus() == 1) {
                 $this->_popup_controller->setErrorReturn(115, 'agb_not_accepted', array());
             }
             if ($account_mode == 'to_room') {
                 // 		        $this->_popup_controller->setSuccessfullItemIDReturn($form_data['iid']);
                 // 		      	$this->_popup_controller->setSuccessfullItemIDReturn($this->_environment->getCurrentContextID());
                 $data['cid'] = $this->_environment->getCurrentContextID();
                 if ($label_item) {
                     $data['item_id'] = $label_item->getItemID();
                     $data['mod'] = 'group';
                 } else {
                     $data['item_id'] = $room_item->getItemID();
                     $data['mod'] = 'project';
                 }
                 $this->_popup_controller->setSuccessfullDataReturn($data);
             } else {
                 $data['cid'] = $this->_environment->getCurrentContextID();
                 if ($label_item) {
                     $data['item_id'] = $label_item->getItemID();
                     $data['mod'] = 'group';
                 } else {
                     $data['item_id'] = $room_item->getItemID();
                     $data['mod'] = 'project';
                 }
                 $this->_popup_controller->setSuccessfullDataReturn($data);
                 // 		        $this->_popup_controller->setSuccessfullItemIDReturn($this->_environment->getCurrentContextID());
             }
             //---
             // set return
             break;
     }
 }
 private function getAdditionalInformation()
 {
     $return = array();
     $current_context = $this->_environment->getCurrentContextItem();
     $translator = $this->_environment->getTranslationObject();
     $return['dates_status'] = $current_context->getDatesPresentationStatus();
     $todo_status_array = $current_context->getExtraToDoStatusArray();
     $status_array = array();
     foreach ($todo_status_array as $key => $value) {
         $temp_array['text'] = $value;
         $temp_array['value'] = $key;
         $status_array[] = $temp_array;
     }
     $return['additional_extra_status_array'] = $status_array;
     // rss
     if ($current_context->isRSSOn()) {
         $return['rss'] = 'yes';
     } else {
         $return['rss'] = 'no';
     }
     // announcement date
     if ($current_context->withAnnouncementDates()) {
         $return['announcement_date'] = 'yes';
     }
     //buzzwords
     if ($current_context->withBuzzwords()) {
         $return['buzzword'] = 'yes';
     }
     if ($current_context->isBuzzwordMandatory()) {
         $return['buzzword_mandatory'] = 'yes';
     }
     if ($current_context->isBuzzwordShowExpanded()) {
         $return['buzzword_fadeout'] = 'yes';
     }
     if ($current_context->isTagsShowExpanded()) {
         $return['tags_fadeout'] = 'yes';
     }
     //tags
     if ($current_context->withTags()) {
         $return['tags'] = 'yes';
     }
     if ($current_context->isTagMandatory()) {
         $return['tags_mandatory'] = 'yes';
     }
     if (!$current_context->isTagEditedByAll()) {
         $return['tags_edit'] = 'yes';
     }
     $return['time_spread'] = $current_context->getTimeSpread();
     if ($current_context->isTemplate()) {
         $return['template'] = 1;
     }
     if ($current_context->isCommunityRoom()) {
         $return['template_availability'] = $current_context->getCommunityTemplateAvailability();
     } else {
         $return['template_availability'] = $current_context->getTemplateAvailability();
     }
     $return['template_description'] = $current_context->getTemplateDescription();
     if ($current_context->isOpen()) {
         $return['room_status'] = '';
     } else {
         $return['room_status'] = '2';
     }
     $with_archving_rooms = $this->_environment->getConfiguration('c_archive_rooms');
     if (isset($with_archving_rooms) and $with_archving_rooms) {
         $return['with_archiving_rooms'] = true;
     } else {
         $return['with_archiving_rooms'] = false;
     }
     $agb_text_array = $current_context->getAGBTextArray();
     $languages = $this->_environment->getAvailableLanguageArray();
     foreach ($languages as $language) {
         if (!empty($agb_text_array[cs_strtoupper($language)])) {
             $return['agb_text_' . cs_strtoupper($language)] = $agb_text_array[cs_strtoupper($language)];
         } else {
             $return['agb_text_' . cs_strtoupper($language)] = '';
         }
     }
     $return['agb_status'] = $current_context->getAGBStatus();
     if ($return['agb_status'] != '1') {
         $return['agb_status'] = '2';
     }
     if ($current_context->isActionBarVisibleAsDefault()) {
         $return['action_bar_visibility'] = '1';
     } else {
         $return['action_bar_visibility'] = '-1';
     }
     if ($current_context->isReferenceBarVisibleAsDefault()) {
         $return['reference_bar_visibility'] = '1';
     } else {
         $return['reference_bar_visibility'] = '-1';
     }
     if ($current_context->isDetailsBarVisibleAsDefault()) {
         $return['details_bar_visibility'] = '1';
     } else {
         $return['details_bar_visibility'] = '-1';
     }
     if ($current_context->isAnnotationsBarVisibleAsDefault()) {
         $return['annotations_bar_visibility'] = '1';
     } else {
         $return['annotations_bar_visibility'] = '-1';
     }
     return $return;
 }
 /** loads the selected and given values to the form
  * this methods loads the selected and given values to the form from the material item or the form_post data
  */
 function _prepareValues()
 {
     $this->_values = array();
     if (isset($this->_item)) {
         $this->_values['iid'] = $this->_item->getItemID();
         $description_array = $this->_item->getOutOfServiceArray();
         $languages = $this->_environment->getAvailableLanguageArray();
         foreach ($languages as $language) {
             if (!empty($description_array[cs_strtoupper($language)])) {
                 $this->_values['oos_' . $language] = $description_array[cs_strtoupper($language)];
             } else {
                 $this->_values['oos_' . $language] = $this->_translator->getMessageInLang($language, 'SERVER_CONFIGURATION_OOS_DEFAULT_TEXT');
             }
         }
         if ($this->_item->showOutOfService()) {
             $this->_values['oos_show'] = 1;
         } else {
             $this->_values['oos_show'] = -1;
         }
     } elseif (isset($this->_form_post)) {
         $this->_values = $this->_form_post;
     }
 }
Ejemplo n.º 18
0
 /** is user_id free
  * this method returns a boolean whether the user_id is free to choose
  * needed because of german umlauts
  *
  * @param string user_id id of the user (not item id)
  *
  * @return boolean true, if user_id is free
  *                 false, if user_id is not free
  */
 function is_free($user_id)
 {
     if ($this->_translator == null) {
         global $environment;
         $this->_translator = $environment->getTranslationObject();
     }
     $retour = true;
     $item = '';
     $user_id_array = $this->_getMultipleUserIDArray($user_id);
     foreach ($user_id_array as $user_id_to_check) {
         $this->_get($user_id_to_check);
         if (isset($this->_item)) {
             $user_id_to_check = $this->_item->getUserID();
             if (!empty($user_id_to_check)) {
                 $retour = false;
                 if (cs_strtoupper($user_id_to_check) != cs_strtoupper($user_id)) {
                     $this->_error_array[] = $this->_translator->getMessage('AUTH_ERROR_ACCOUNT_EXIST', $user_id_to_check);
                 }
             }
         }
     }
     return $retour;
 }