Beispiel #1
0
function current_page($params)
{
    global $this_page, $parent_page;
    $page = $params['page'];
    $class = getArrayValue($params, 'class');
    if ($class == '') {
        $class = "selected";
    }
    if ($page == $parent_page) {
        return ' class="' . $class . '" ';
    } else {
        return false;
    }
}
Beispiel #2
0
 /**
  * Function used to insert log
  * @param VARCHAR $type, type of action
  * @param ARRAY $details_array , action details array
  */
 function insert($type, $details_array)
 {
     global $db, $userquery;
     $a = $details_array;
     $ip = $_SERVER['REMOTE_ADDR'];
     $agent = $_SERVER['HTTP_USER_AGENT'];
     $userid = getArrayValue($a, 'userid');
     $username = $a['username'];
     $useremail = getArrayValue($a, 'useremail');
     $userlevel = getArrayValue($a, 'userlevel');
     $action_obj_id = getArrayValue($a, 'action_obj_id');
     $action_done_id = getArrayValue($a, 'action_done_id');
     $userid = $userid ? $userid : $userquery->udetails['userid'];
     $username = $username ? $username : $userquery->udetails['username'];
     $useremail = $useremail ? $useremail : $userquery->udetails['email'];
     $userlevel = $userlevel ? $userlevel : getArrayValue($userquery->udetails, 'level');
     $success = $a['success'];
     $details = getArrayValue($a, 'details');
     $db->insert(tbl('action_log'), array('action_type', 'action_username', 'action_userid', 'action_useremail', 'action_ip', 'date_added', 'action_success', 'action_details', 'action_userlevel', 'action_obj_id', 'action_done_id'), array($type, $username, $userid, $useremail, $ip, NOW(), $success, $details, $userlevel, $action_obj_id, $action_done_id));
 }
Beispiel #3
0
 /**
  * INIT
  */
 function init()
 {
     $lang = mysql_clean(getArrayValue($_COOKIE, 'cb_lang'));
     //Setting Language
     if (isset($_GET['set_site_lang'])) {
         $lang = $_GET['set_site_lang'];
         if ($this->lang_exists($lang)) {
             setcookie('cb_lang', $lang, time() + 3600, '/');
         }
     }
     if (isset($lang) and !empty($lang)) {
         $lang_details = $this->lang_exists($lang);
     }
     if (isset($lang) && isset($lang_details)) {
         $default = $lang_details;
     } else {
         $default = $this->get_default_language();
     }
     if ($default['language_code']) {
         $this->lang = $this->lang_iso = $default['language_code'];
     }
 }
Beispiel #4
0
 /**
  * Function used to add session
  * @todo: Find a proper solution to avoid database crashing because of sessions insertion and updation
  */
 function add_session($user, $name, $value = false, $reg = false)
 {
     global $db, $pages;
     if (!$value) {
         $value = $this->id;
     }
     $this->get_user_session($user, $name, true);
     if ($db->num_rows > 0) {
         $db->delete(tbl($this->tbl), array('session_string', 'session'), array($name, $this->id));
     }
     $cur_url = $pages->GetCurrentUrl();
     if (THIS_PAGE != 'cb_install') {
         if ($name === "guest" && config("store_guest_session") !== "yes") {
             // do nothing
         } else {
             $db->insert(tbl($this->tbl), array('session_user', 'session', 'session_string', 'ip', 'session_value', 'session_date', 'last_active', 'referer', 'agent', 'current_page'), array($user, $this->id, $name, $_SERVER['REMOTE_ADDR'], $value, now(), now(), getArrayValue($_SERVER, 'HTTP_REFERER'), $_SERVER['HTTP_USER_AGENT'], $cur_url));
         }
     }
     if ($reg) {
         //Finally Registering session
         $this->session_register($name);
         $this->session_val($name, $value);
     }
 }
Beispiel #5
0
        ?>
												<option value="<?php 
        echo $i;
        ?>
"><?php 
        echo $i;
        ?>
</option>
<?php 
    }
}
?>
											</select>
											
											<?php 
echo getArrayValue(explode('%1', _t('한 페이지에 글 %1건 표시')), 1);
?>
										</div>
									</div>
								</div>
							</form>
							
							<hr class="hidden" />
							
							<form id="search-form" class="data-subbox" method="post" action="<?php 
echo $context->getProperty('uri.blog');
?>
/owner/communication/trash/trackback">
								<h2><?php 
echo _t('검색');
?>
Beispiel #6
0
function getArrayKey(array $array, $value)
{
    return getArrayValue($array, $value, true);
}
 function cbMenu($params = NULL)
 {
     $this->head_menu($params);
     if (!$params['tag']) {
         //$params['tag'] = 'li';
         if (!$params['class']) {
             $params['class'] = '';
         }
     }
     if (!isset($params['getSubTab'])) {
         $params['getSubTab'] = '';
     }
     if (!isset($params['parentTab'])) {
         $params['parentTab'] = '';
     }
     if (!isset($params['selectedTab'])) {
         $params['selectedTab'] = '';
     }
     $headMenu = $this->head_menu;
     $custom = isset($this->custom_menu) ? $this->custom_menu : false;
     if (is_array($custom)) {
         $headMenu = array_merge($headMenu, $custom);
     }
     /* Excluding tabs from menu */
     if (isset($params['exclude'])) {
         if (is_array($params['exclude'])) {
             $exclude = $params['exclude'];
         } else {
             $exclude = explode(",", $params['exclude']);
         }
         foreach ($headMenu as $key => $hm) {
             foreach ($exclude as $ex) {
                 $ex = trim($ex);
                 if (strtolower(trim($hm['name'])) == strtolower($ex)) {
                     unset($headMenu[$key]);
                 }
             }
         }
     }
     $main_menu = array();
     foreach ($headMenu as $menu) {
         if (isSectionEnabled($menu['this'])) {
             $selected = current_page(array("page" => $menu['this']));
             if ($selected) {
                 $menu['active'] = true;
             }
             $main_menu[] = $menu;
         }
     }
     $output = "";
     //if(($params['tag']))
     //		$output .= "<".$params['tag'].">";
     foreach ($main_menu as $menu) {
         $selected = getArrayValue($menu, 'active');
         $output .= "<li ";
         $output .= "id = 'cb" . $menu['name'] . "Tab'";
         $output .= " class = '";
         if ($params['class']) {
             $output .= $params['class'];
         }
         if ($selected) {
             $output .= " selected";
         }
         $output .= "'";
         if (isset($params['extra_params'])) {
             $output .= $params['extra_params'];
         }
         $output .= ">";
         $output .= "<a href='" . $menu['link'] . "'>";
         $output .= $menu['name'] . "</a>";
         $output .= "</li>";
     }
     //if(($params['tag']))
     //		$output .= "</".$params['tag'].">";
     if (SMARTY_VERSION < 3) {
         if ($params['echo']) {
             echo $output;
         } else {
             return $output;
         }
     } else {
         if (isset($params['echo'])) {
             echo $output;
         } else {
             return $main_menu;
         }
     }
 }
    $formValues = $_POST;
    foreach ($MAX_LENGTHS as $key => $value) {
        $formValues[$key] = Format::limitLength($formValues[$key], $MAX_LENGTHS[$key]);
    }
    $foundProfile = Doctrine::findMembre($numeroMembre);
    // Don't generate method calls to avoid potential security hole.
    $foundProfile->setStatut($formValues['statut']);
    $foundProfile->setEnfants($formValues['enfants']);
    $foundProfile->setDevise($formValues['devise']);
    $foundProfile->setCoordonnee('email', $formValues['email'], $formValues['emailPrive']);
    $foundProfile->setCoordonnee('phone', $formValues['telephone'], $formValues['telephonePrive']);
    $adresseValue = ['address' => trim("{$formValues['adresse1']}\n{$formValues['adresse2']}\n{$formValues['adresse3']}"), 'code' => $formValues['codePostal'], 'city' => $formValues['ville'], 'country' => $formValues['pays']];
    $foundProfile->setCoordonnee('address', json_encode($adresseValue), $formValues['adressePrivee']);
    $foundProfile->setLangues(getArrayValue($formValues, 'langues'));
    $foundProfile->setCompetences(getArrayValue($formValues, 'competences'));
    $foundProfile->setPassions(getArrayValue($formValues, 'passions'));
    Doctrine::persist($foundProfile);
    Doctrine::flush();
    $ldapResult = LdapSync::updateProfile($numeroMembre, $foundProfile->jsonSerialize());
    if ($ldapResult) {
        // Then it's an error.
        $logger->error("Ldap error updating status for #{$numeroMembre}: {$ldapResult}");
    }
    echo json_encode($foundProfile);
} else {
    $logger->info('Found validation errors: ' . print_r($v->errors(), true));
    $errors = [];
    foreach ($v->errors() as $fieldName => $fieldErrors) {
        foreach ($fieldErrors as $message) {
            $errors[] = $message;
        }
Beispiel #9
0
if ($Cbucket->LatestAdminMenu()) {
    $Cbucket->AdminMenu = array_merge($Cbucket->LatestAdminMenu(), $Cbucket->AdminMenu);
}
//Assigning Smarty Tags & Values
Assign('CB_VERSION', CB_VERSION);
Assign('FFMPEG_FLVTOOLS_BINARY', getConstant('FFMPEG_FLVTOOLS_BINARY'));
Assign('FFMPEG_MPLAYER_BINARY', getConstant('FFMPEG_MPLAYER_BINARY'));
Assign('PHP_PATH', PHP_PATH);
Assign('FFMPEG_BINARY', getConstant('FFMPEG_BINARY'));
Assign('FFMPEG_MENCODER_BINARY', getConstant('FFMPEG_MENCODER_BINARY'));
Assign('js', JS_URL);
Assign('title', TITLE);
Assign('slogan', SLOGAN);
Assign('flvplayer', FLVPLAYER);
Assign('avatardir', BASEURL . '/images/avatars');
Assign('whatis', getArrayValue($row, 'whatis'));
Assign('category_thumbs', CAT_THUMB_URL);
Assign('gp_thumbs_url', GP_THUMB_URL);
Assign('video_thumbs', THUMBS_URL);
//Assign('ads',$ads);
Assign('email_verification', EMAIL_VERIFICATION);
Assign('group_thumb', BASEURL . '/images/groups_thumbs');
Assign('bg_dir', BASEURL . '/images/backgrounds');
Assign('captcha_type', $row['captcha_type']);
Assign('languages', isset($languages) ? $languages : false);
Assign('module_dir', MODULEDIR);
Assign('VIDEOS_URL', VIDEOS_URL);
Assign('THUMBS_URL', THUMBS_URL);
Assign('PLUG_URL', BASEURL . '/plugins');
//Remote and Embed
Assign('remoteUpload', $row['remoteUpload']);
Beispiel #10
0
													<option value="1"<?php 
echo $blog['publishWholeOnRSS'] ? ' selected="selected"' : '';
?>
><?php 
echo _t('전체공개');
?>
</option>
													<option value="0"<?php 
echo $blog['publishWholeOnRSS'] ? '' : ' selected="selected"';
?>
><?php 
echo _t('부분공개');
?>
</option>
												</select><?php 
echo getArrayValue(explode('%1', _t('RSS 파일의 글 본문은 %1를 원칙으로 합니다.')), 1);
?>
											</dd>

										</dl>
									</fieldset>
								</div>
<?php 
echo setDetailPanel('panelEtcSetting', 'button');
?>
								
								<div id="panelEtcSetting" class="section folding">
									<fieldset class="container">
										<legend><?php 
echo _t('기타');
?>
Beispiel #11
0
/**
 * This function used to include headers in <head> tag
 * it will check weather to include the file or not
 * it will take file and its type as an array
 * then compare its type with THIS_PAGE constant
 * if header has TYPE of THIS_PAGE then it will be inlucded
 */
function include_header($params)
{
    $file = getArrayValue($params, 'file');
    $type = getArrayValue($params, 'type');
    if ($file == 'global_header') {
        Template(BASEDIR . '/styles/global/head.html', false);
        return false;
    }
    if ($file == 'admin_bar') {
        if (has_access('admin_access', TRUE)) {
            Template(BASEDIR . '/styles/global/admin_bar.html', false);
        }
        return false;
    }
    if (!$type) {
        $type = "global";
    }
    if (is_includeable($type)) {
        Template($file, false);
    }
    return false;
}