Commit b0f22c90 authored by f4eyq's avatar f4eyq

update 2020-05-17

parent 0ea04961
------------------------
-----------------------------------------
CRX FRAMEWORK
-----------------------------------------
Date: 01/2008
Current version: 3.0 ( 6 )
-----------------------------------------
Current version: 3.1 (year update 8)
-----------------------------------------
------------------------
Update 17/05/2020
------------------------
- Improve crxUser, add new start_module option.
------------------------
Update 04/03/2020
......
......@@ -251,7 +251,7 @@ extends crxCore{
if(isset($this->_env['redirect_process']) && !empty($this->_env['redirect_process'])){
return crxFrameworkWebCommon::redirect($this->_env['redirect_process']);
return crxFrameworkWebCommon::sredirect($this->_env['redirect_process']);
}
......
......@@ -192,7 +192,8 @@ CREATE TABLE `crx_users_donation` (
'date_register',
'user_description',
'date_visit',
'user_display_conf'
'user_display_conf',
'start_module'
);
var $_userTableDirectoryShema = array(
......@@ -540,6 +541,7 @@ $exec='curl -X POST '.$uri.' \
return array();
}
//@todo missing disable cache parameter use
function getValue($k,$user_id,$disable_cache=FALSE){
if(isset($_SESSION['user_cache_get_value'][$user_id][$k])){
return $_SESSION['user_cache_get_value'][$user_id][$k];
......@@ -652,7 +654,8 @@ $exec='curl -X POST '.$uri.' \
function checkLoginAndPassword($login,$password){
$hm=crxFramework::getFrameworkConfigurationValue('userPasswordHashMethod');
$l=false;
if($hm==null){$hm='sha256';}
$this->_dataAccess->formatSqlQuery('',$this->_table_users,'DISPLAY','',
......@@ -663,42 +666,53 @@ $exec='curl -X POST '.$uri.' \
);
$this->_dataAccess -> execSql();
$getHashMethod = $this->_dataAccess->returnLine();
$getHashMethod=explode(':',$getHashMethod['pwd_user']);
//No hash conf in password :
if(count($getHashMethod) == 1 ){
if(isset($getHashMethod['pwd_user'])){
$getHashMethod=explode(':',$getHashMethod['pwd_user']);
}
//No hash conf in password :
if(is_array($getHashMethod) && count($getHashMethod) == 1 ){
$password_test = md5($password);//old method/compatible for the moment for old profile/or non updated password.
$method = 'md5';
}
////Ex: sha256:[SUM PWD STRING]
else{
$method = $getHashMethod[0];
$password_test = $method.':'.hash($method,$password);//old method.
if(isset($getHashMethod[0])){
$method = $getHashMethod[0];
$password_test = $method.':'.hash($method,$password);//old method.
}
else{
$password_test = -1;
}
}
$this->_dataAccess->formatSqlQuery('',$this->_table_users,'DISPLAY','',
array(
'filter_key' => 'login_user',
if($password_test<>-1){
$this->_dataAccess->formatSqlQuery('',$this->_table_users,'DISPLAY','',
array(
'filter_key' => 'login_user',
'filter_key_value' => $login,
'AND_filter_key' => 'pwd_user',
'AND_filter_value' => $password_test,
)
);
$this->_dataAccess -> execSql();
$m_ = $l = $this->_dataAccess->returnLine();
);
$this->_dataAccess -> execSql();
$m_ = $l = $this->_dataAccess->returnLine();
}
$this->__loadCrxSysLog();
$ip = $this->getIP();
$m="succefully open web session.";
if(!$l){
if(!isset($l) || !$l){
$m="failed to open web session.";
}
if(isset($m_['id_user']) && $l['account_enable']<>1){
$m="account not enable.";
$m="account not enable.";
$l=FALSE;
}
$call='';
$call='';
$uid=-1;
if(isset($m_['login_user'])) $call = $m_['login_user'];
if(isset($m_['callsign_main'])) $call .= '/'.$m_['callsign_main'];
......
......@@ -188,7 +188,6 @@ class genericOb{
$this->itemsProperties=array();
}
function retreive($fields=array(),$use_field='',$return_method='BOTH'){
......
......@@ -3,7 +3,7 @@
* CRX-FRAMEWORK
* @author Bastien Barbe
* @date 01/01/2005
* @revision 28/05/2019
* @revision 15/05/2019
* @lib languages
* @version 1.2.2-1
*/
......@@ -125,19 +125,25 @@ class crxLanguage extends crxFramework{
}
function loadDictionnary($disable_cache=0,$debug=0){
function loadDictionnary($disable_cache=0,$debug=0,$force_module_dir=''){
$d=0;
if($force_module_dir=='common'){$d=1;}
if(!isset($this->_current_module_information['module_directory']))return;
$module_dir_name=$this->_current_module_information['module_directory'];
$this->_debug_lng=$debug;
if($disable_cache == 0 && crxFramework::getFrameworkObjectsOption('caching_ini_to_php')){
//debugAndContinue('[INFO] try to load php file => '.$path_cache_lang_include_php_file,$this->_debug_lng);
//Try to load compiled version :
$path_cache_lang_include_php_file = _CACHE_PXML_FOLDER_.$this->_current_module_information['module_directory']._SD_.$this->_currentLanguageInUse._SD_.'lang.php';
$path_cache_lang_include_php_file = _CACHE_PXML_FOLDER_.$module_dir_name._SD_.$this->_currentLanguageInUse._SD_.'lang.php';
debugAndContinue('[INFO] try to load php file => '.$path_cache_lang_include_php_file,$this->_debug_lng);
$lang = $this->_currentLanguageInUse;
if(file_exists($path_cache_lang_include_php_file)){
......@@ -145,12 +151,23 @@ class crxLanguage extends crxFramework{
debugAndContinue('[INFO] caching_ini_to_php => 1',DEBUG_LNG_LAYER);
debugAndContinue('[INFO] Loading php lng file : '.$path_cache_lang_include_php_file.' lang ('.$this->_currentLanguageInUse.')',DEBUG_LNG_LAYER);
require($path_cache_lang_include_php_file);
require($path_cache_lang_include_php_file);
//require_once doesnt work now.
/*if($this->_debug_lng){
var_dump($path_cache_lang_include_php_file);
var_dump($this->_dic);
echo time();
}*/
if( empty($this->_dic) || !($this->_dic)){
debugAndContinue('[INFO] Language values not found lang => '.$lang.', module=>'.$this->_current_module_information['module_directory'],DEBUG_LNG_LAYER);
}else{
debugAndContinue('[INFO] Language ('.count($this->_dic).')values found, lang => '.$lang.', module=>'.$this->_current_module_information['module_directory'],DEBUG_LNG_LAYER);
debugAndContinue('[INFO] Language values not found lang => '.$lang.', module=>'.$module_dir_name,DEBUG_LNG_LAYER);
}
else{
debugAndContinue('[INFO] Language ('.count($this->_dic).')values found, lang => '.$lang.', module=>'.$module_dir_name,DEBUG_LNG_LAYER);
}
return $this->_dic;
}
else{
......@@ -159,7 +176,7 @@ class crxLanguage extends crxFramework{
if(file_exists($path_cache_lang_include_php_file)){
require($path_cache_lang_include_php_file);
if( empty($this->_dic) || !($this->_dic)){
debugAndContinue('[INFO] Language values not found lang => '.$lang.', module=>'.$this->_current_module_information['module_directory'],$this->_debug_lng);
debugAndContinue('[INFO] Language values not found lang => '.$lang.', module=>'.$module_dir_name,$this->_debug_lng);
}else{
debugAndContinue('[INFO] Successfully load PHP file:'.$path_cache_lang_include_php_file,$this->_debug_lng);
}
......
<?php
//////////////////////////////////////////////////////////
//Interface class to use dxClusterSpot HAM or 11M.
//u:122019
//up:15/05/2020
//////////////////////////////////////////////////////////
namespace crx;
class dxClusterSpot {
var $__mode = '';
var $c_db = '';
var $debug = false;
function setDebug($d){
$this->debug=$d;
$this->d=$d;
}
function getDxClusterStatsContinentDxSpotRepartition($db='spot',$time_select=array('start','end'),$user_continent='EU',$nb_total_spots=0,$user_band_selected='ALL',$debug=0){
//HAM Radio mode :
if($this->__mode == 'HAM'){
......@@ -36,9 +31,7 @@ class dxClusterSpot {
}
$sp->d=$this->d;
$sp->setTableSpotName($db);
$sp->initCqZoneByContinent();
return $sp->getDxClusterStatsContinentDxSpotRepartition(
......@@ -65,15 +58,17 @@ class dxClusterSpot {
function getSpotDataKey($mode){
$spot_data_keys['HAM']['spotter']='spotter';
$spot_data_keys['HAM']['spotcall']='spotcall';
$spot_data_keys['11M']['spotter']='callsign_sender';
$spot_data_keys['11M']['spotcall']='callsign_dx';
$spot_data_keys['HAM']['spotter'] = 'spotter';
$spot_data_keys['HAM']['spotcall'] = 'spotcall';
$spot_data_keys['HAM']['freq'] = 'freq';
$spot_data_keys['HAM']['comment'] = 'comment';
$spot_data_keys['HAM']['time'] = 'time';
$spot_data_keys['11M']['spotter'] = 'callsign_sender';
$spot_data_keys['11M']['spotcall'] = 'callsign_dx';
$spot_data_keys['11M']['freq'] = 'frequency';
$spot_data_keys['11M']['comment'] = 'comment';
$spot_data_keys['11M']['time'] = 'date_spot';
return $spot_data_keys[$mode];
......@@ -180,8 +175,9 @@ class dxClusterSpot {
$s=new dxClusterSpot11m();
$s->setDbHandler($this->c_db);
$s->setDebug($this->debug);
$filters['tbl_crx_spots'] = 'crx_cluster_spots';
$filters['filters_order_by'] = 'date_spot';
$filters['tbl_crx_spots'] = 'crx_cluster_spots';
$filters['filters_order_by'] = 'date_spot';
$filters['bands_filtering_selected'] = array(0=>11,1=>'PMR');
}
$s->setCallsignSender($usr['callsign_main']);
......
<?php
/**
* @date 01/01/2005
* @revision 08/04/2020
* @revision 15/05/2020
* @lib radioamator
* @copyright see header
*/
......@@ -458,7 +458,11 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
$bands=0;
foreach($this->bands_filtering_selected as $k=>$v){
if($v==1)$sql_set_filter .= ' band = "'.$k.'" ';
if($k=='11m')$k='11';
//if($k=='11m')$k='PMR';
if($v==1)$sql_set_filter .= ' `band` = "'.$k.'" ';
if($i>=0 && $i<=(count($this->bands_filtering_selected)-2)){
$sql_set_filter .= 'OR';
}
......@@ -468,16 +472,17 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
$sql_set_filter .= ')';
}
}
$sql_get_data='SELECT * FROM `'.$this->display_tbl_crx_spots.'`';
if($disable_limit_and_count){
$sql_get_data='SELECT COUNT(*) as `nb_spots` FROM `'.$this->display_tbl_crx_spots.'`';
$sql_get_data='SELECT COUNT(*) as `C` FROM `'.$this->display_tbl_crx_spots.'`';
}
$join_this_filter='';
if($this->display_use_dxnodes_filter){
$join_this_filter='WHERE';
if($sql_set_filter){
......@@ -506,11 +511,7 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
}
if($this->display_use_modes_filter){
//if($sql_set_filter_columns_settings==NULL) $join_this_filter=' WHERE';
//else $join_this_filter=' AND';
$i=0;foreach($this->display_use_modes_filter as $k=>$v){
if($v==1){ $i++; }
}
......@@ -519,7 +520,6 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
$i=-1;
}
if($i<>-1){
if($sql_set_filter){
$sql_set_filter .= " AND ";
......@@ -544,7 +544,6 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
if($this->display_use_callsign_dx_filter){
if(!$sql_set_filter){
$sql_set_filter .= " WHERE ";
}
......@@ -554,7 +553,7 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
$i=0;foreach($this->display_use_callsign_dx_filter as $k=>$v){$i++;}
$j=0;foreach($this->display_use_callsign_dx_filter as $k=>$v){
if($v['operator_not']==1)$op=' <> ';
if(isset($v['operator_not']) && $v['operator_not']==1)$op=' <> ';
else $op=' = ';
if($j==0) $sql_set_filter .= $join_this_filter." ( `callsign_dx` ".$op." '".$v['value']."' ";
if($j<>0 && $j>$i) $sql_set_filter .= " AND `callsign_dx` ".$op." '".$v['value']."' ";
......@@ -575,7 +574,7 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
$i=0;foreach($this->display_use_callsign_sender_filter as $k=>$v){$i++;}
$j=0;foreach($this->display_use_callsign_sender_filter as $k=>$v){
if($v['operator_not']==1)$op=' <> ';
if(isset($v['operator_not']) && $v['operator_not']==1)$op=' <> ';
else $op=' = ';
if($j==0) $sql_set_filter .= $join_this_filter." ( `callsign_sender` ".$op." '".$v['value']."' ";
if($j<>0 && $j>$i) $sql_set_filter .= " AND `callsign_sender` ".$op." '".$v['value']."' ";
......@@ -635,7 +634,7 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
}
}
$sql_limit_result=' ORDER BY '.$this->display_filters_order_by.' DESC LIMIT '.$sql_limit_result;
$sql_limit_result=' ORDER BY `'.$this->display_filters_order_by.'` DESC LIMIT '.$sql_limit_result;
if($disable_limit_and_count){
$sql_limit_result='';
}
......@@ -643,12 +642,8 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
$final_querie_get_dxcluster_spots = $sql_get_data." ".$sql_set_filter.$sql_set_filter_columns_settings." ".$sql_limit_result;
$this->c_db -> query = $final_querie_get_dxcluster_spots;
//echo($final_querie_get_dxcluster_spots);
//die();
//if($this->debug)crxFile::setFileContent('/debugpath/test.log','DEBUG:'.dumper($final_querie_get_dxcluster_spots));
$this->_q=$final_querie_get_dxcluster_spots;
return $this->c_db -> getArrayOfResult();
}
......@@ -1071,7 +1066,7 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
$extract['unit'].=$unit_slash;
}
if(!$extract['unit']){
if(!isset($extract['unit']) || !$extract['unit']){
# 14 CRX / DX
if(preg_match("(^([0-9]{1,3})([A-Za-z]{1,8})\/(([A-Za-z0-9]{1,6})))",$call,$q)){
......
......@@ -2,20 +2,20 @@
/**
* @author Bastien Barbe - CRX-FRAMEWORK
* @creation date 12/2014
* @revision 26/03/2020
* @revision 01/05/2020
* @module radioamator
* @version 1.2.3 (2)
* @version 1.2.3 (3)
*/
namespace crx;
class spotQrg{
function __construct(){ }
function frequencyRulesCompilation($protocol,$dxm = null){
$is_usb_qrg=10000;
$q = new spotQrg();
$dataqrg = spotQrg::getBandsValues();
......@@ -50,6 +50,9 @@ class spotQrg{
//$dataqrg['70cm']=$tmp['70cm']; //$dataqrg['80m']=$tmp['80m'];//$dataqrg['500khz']=$tmp['500khz'];
//$dataqrg['40m']=$tmp['40m']; //$dataqrg['20m']=$tmp['20m']; //$dataqrg['10m']=$tmp['10m']; //$dataqrg['12m']=$tmp['12m'];
//$dataqrg['6m']=$tmp['6m']; //$dataqrg['2m']=$tmp['2m']; //$dataqrg['15m']=$tmp['15m']; //$dataqrg['60m']=$tmp['60m'];
foreach($dataqrg as $band=>$bproperties){
if(!in_array($band,$exlude_bands)){
$start=$bproperties['band'][0];
......@@ -211,13 +214,13 @@ class spotQrg{
foreach($range[$band] as $k=>$v){
if($protocol=='yaesu0'){
if($v['type']=='rtty' || $v['type']=='ft8'|| $v['type']=='sstv'){
if($range[$k]['start']>=14000){$m='USB';}
if($range[$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['desc'] = $hp.$range[$band][$k]['type'];
$range[$band][$k]['type'] = $m;
}
if($v['type']=='ssb'){
if($range[$k]['start']>=14000){$m='USB';}
if($range[$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['desc'] = $hp.$range[$band][$k]['type'];
$range[$band][$k]['type'] = $m;
......@@ -234,7 +237,7 @@ class spotQrg{
$range[$band][$k]['type'] = 'DIG';
}
if($v['type']=='ssb'){
if(isset($range[$k]['start']) && $range[$k]['start']>=14000){$m='USB';}
if(isset($range[$k]['start']) && $range[$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['type'] = $m;
$range[$band][$k]['desc'] = $hp.$m;
......@@ -247,14 +250,14 @@ class spotQrg{
}
if($protocol=='yaesu2'){//no DIG here , we put LSB or SSB :
if(isset($v['type']) && ($v['type']=='rtty' || $v['type']=='ft8'|| $v['type']=='sstv')){
if($range[$band][$k]['start']>=14000){$m='USB';}
if($range[$band][$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['desc'] = $hp.$range[$band][$k]['type'];
$range[$band][$k]['type'] = $m;
}
if(isset($v['type']) && $v['type']=='ssb'){
if($range[$band][$k]['start']>=14000){$m='USB';}
if($range[$band][$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['desc'] = $hp.$range[$band][$k]['type'];
$range[$band][$k]['type'] = $m;
......@@ -266,14 +269,14 @@ class spotQrg{
}
if($protocol=='yaesu3'){//ft1000/mp support, for the moment put only cw,lsb,usb.
if(isset($v['type']) && ($v['type']=='rtty' || $v['type']=='ft8'|| $v['type']=='sstv')){
if($range[$band][$k]['start']>=14000){$m='USB';}
if($range[$band][$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['desc'] = $hp.$range[$band][$k]['type'];
$range[$band][$k]['type'] = $m;
}
if(isset($v['type']) && $v['type']=='ssb'){
if($range[$band][$k]['start']>=14000){$m='USB';}
if($range[$band][$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['desc'] = $hp.$range[$band][$k]['type'];
$range[$band][$k]['type'] = $m;
......@@ -285,13 +288,13 @@ class spotQrg{
}
if($protocol=='elecraft1' || $protocol=='kenwood1' || $protocol=='icom1'){
if($v['type']=='rtty' || $v['type']=='ft8'|| $v['type']=='sstv'){
if($range[$band][$k]['start']>=14000){$m='USB';}
if($range[$band][$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['desc'] = $hp.$range[$band][$k]['type'];
$range[$band][$k]['type'] = $m;
}
if($v['type']=='ssb'){
if($range[$band][$k]['start']>=14000){$m='USB';}
if($range[$band][$k]['start']>=$is_usb_qrg){$m='USB';}
else{$m='LSB';}
$range[$band][$k]['desc'] = $hp.$range[$band][$k]['type'];
$range[$band][$k]['type'] = $m;
......
......@@ -587,12 +587,10 @@ class dbDriver extends crxDataSource{
}
catch(crxException $e){
if(CFG_plateforme=='dev')
throw new \crx\crxException($this->XmlConfFile._BR_.$e);
}
/*
$log='/home/hosting/www_root/ham.crx.cloud/conf/conf-cache/sql.log.txt';
$c=file_get_contents($log);
......@@ -624,7 +622,7 @@ class dbDriver extends crxDataSource{
}
}
if( $this->dataInstance ){
//if($this->queryId = mysql_query($req_input, $this->dataInstance)){
if($this->queryId = mysqli_query($this->dataInstance,$req_input)){
......@@ -632,8 +630,11 @@ class dbDriver extends crxDataSource{
}
else{
$this->error = mysql_error($this->dataInstance).'('.mysql_errno($this->dataInstance).')';
//if(CFG_plateforme=='dev')
// throw new \crx\crxException(_BR_.'Datasource conf xml : '.$this->XmlConfFile._BR_."MYSQL Error : ".$this->error. " QUERY : ".$req_input);
return FALSE;
}
}
......
......@@ -222,11 +222,9 @@ class crxBootLoader{
static function __initHttpHeaderForWebClient(){
header('Content-type: text/html; charset=UTF-8'); //Use UFT8 charset (must be defaut on all web:))
//if(!isset($_SESSION))session_start();
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
//Start user session, persistant storage values!
}
......@@ -443,8 +441,6 @@ class crxBootLoader{
//Create env !
$this->initCrxFrameworkEnvConstants($params);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment