Commit c49a6a4b authored by root's avatar root

update 01022020

parent 9821536e
------------------------
CRX FRAMEWORK
Current version:3.0.1 - 3
Date:01/2008
Date: 01/2008
Current version: 3.0.2 - 3
------------------------
Update 29/01/2020
------------------------
- Update Db MYSQL driver.
- Update HAM Radio dxClusterSpotHam (rbn implementation)
------------------------
Update 14/01/2020
------------------------
- Update HAM Radio locator lib.
------------------------
Update 11/01/2020
------------------------
- Update various libs (bugs corrections).
Running now 3.0.2 - 1
------------------------
Update 24/12/2019
......
......@@ -3,10 +3,10 @@
* CRX-PHP-FRAMEWORK http://git.crx.cloud/crx-php/crx-framework
* @author Bastien Barbe
* @date 01/01/2005
* @revision 07/06/2019
* @revision 29/01/2020
* @package core/crxUsers , frameworkCrxUser.
* @copyright see header
* @version 1.8.2 - 2
* @version 1.8.3 - 1
*/
namespace crx;
......@@ -1283,35 +1283,28 @@ $exec='curl -X POST '.$uri.' \
$var = $this->getUserGroups($userId);
$userGroups = array();
if(($var)){
$i=0;
foreach($var as $k=>$groupId){
//Mod 5/2/2013: add 'id', name
$this->_dataAccess->formatSqlQuery('id, name',$this->_table_groups,'DISPLAY','',array('filter_key'=>'id','filter_key_value'=>$groupId));
$this->_dataAccess->execSql();
$userGroupsData = $this->_dataAccess -> returnLineAsso();
$userGroups[]=array(
'id'=>$userGroupsData['id'],
'name'=>$userGroupsData['name']
);
if(isset($userGroupsData['id']) && isset($userGroupsData['name'])){
$userGroups[$i]=array(
'id' => $userGroupsData['id'],
'name' => $userGroupsData['name']
);
}
$i++;
}
$_SESSION['userGroups'][$userId]=$userGroups;
}
else{
//die('[ERROR] error user is member of any group.');
//return FALSE;
}
return $userGroups;
}
......
......@@ -126,6 +126,10 @@ class crxXml {
$ress_xml = simplexml_load_file($this->_pathOfXmlFile);
if(!$ress_xml){
//echo "@error!";
}
if($itemTypeL2<>null)
$p_cnt = count($ress_xml->$itemType->$itemTypeL2);
else
......
......@@ -3,9 +3,9 @@
* CRX-FRAMEWORK
* @author Bastien Barbe
* @date 01/01/2005
* @revision 02/05/2019
* @revision 11/01/2020
* @crx-core classes
* @version 1.2.2-2
* @version 1.2.3-1
*/
namespace crx;
......@@ -226,11 +226,20 @@ class crxHtmlInterface extends crxFramework{
if(isset($opts['year_range']) && $opts['year_range'])$yc=$opts['year_range'];
else $yc=5;
for($i=date('Y')-$yc;$i <= gmdate('Y')+$yc;$i++){
$this->date['years'][$i]=$i;
if(isset($opts['year_range_back']) && $opts['year_range_back']){
$n=date('Y')-$opts['year_range_back'];
for($i=$n;$i <= gmdate('Y');$i++){
$this->date['years'][$i]=$i;
}
}
else{
for($i=date('Y')-$yc;$i <= gmdate('Y')+$yc;$i++){
$this->date['years'][$i]=$i;
}
}
return $this->date;
}
......@@ -696,7 +705,8 @@ class crxHtmlInterface extends crxFramework{
$data_input=NULL,
$value_selected=NULL,
$mode='',
$js_code=null
$js_code=null,
$style_code=null
)
{
if($mode=='multiple')$this->listMode=$mode;
......@@ -704,8 +714,13 @@ class crxHtmlInterface extends crxFramework{
if(!isset($this->listMode))$this->listMode=NULL;
if(!isset($this->listSize))$this->listSize='';
$astyle_code='';
if($style_code<>null){
$astyle_code.=' style="'.$style_code.'"';
}
$html_ouput="";
$html_ouput .= "\n".'<select id="'.$input_name.'" name="'.$input_name.'" '.$this->listSize.' '.$this->listMode.' '.$js_code.'>'."\n\r";
$html_ouput .= "\n".'<select id="'.$input_name.'" name="'.$input_name.'" '.$this->listSize.' '.$this->listMode.' '.$js_code.''.$astyle_code.'>'."\n\r";
if(!is_array($data_input)){$data_input=array();}
foreach($data_input as $_k=>$_v)
......
......@@ -2,10 +2,10 @@
/**
* @author Bastien Barbe - CRX-FRAMEWORK (cms part)
* @date 01/01/2005
* @revision 31/03/2019
* @revision 11/01/2020
* @module crypto
* @copyright see header
* @version 1.3
* @version 1.3-1
*/
namespace crx;
......@@ -65,7 +65,7 @@ class crxArray{
}
}
function array_push_before($src,$in,$pos,$cast_int_v=FALSE){
static function array_push_before($src,$in,$pos,$cast_int_v=FALSE){
if(is_int($pos)) $R=array_merge(array_slice($src,0,$pos), $in, array_slice($src,$pos));
else{
foreach($src as $k=>$v){
......
......@@ -5,7 +5,7 @@
* @date 01/01/2005
* @revision 01/05/2019
* @lib webapp
* @version 1.5.3-1
* @version 1.5.3-2
*/
namespace crx;
......@@ -867,13 +867,25 @@ class crxDataSource extends crxSchema{
}
function freeMem(){
$this->dbi -> free_mem();
}
function checkConnexion(){
$this->dbi -> ping();
}
function connection(){
try{
$this->dbi -> connection();
}
catch(crxException $e){
throw $e;
......
......@@ -20,7 +20,7 @@
/**
* @author Bastien Barbe - CRX-FRAMEWORK (cms part)
* @date 01/01/2005
* @revision 24/12/2019
* @revision 26/01/2020
* @module data
* @copyright see header
* @version 1.2-1
......@@ -124,7 +124,7 @@ extends crxFramework{
private function endOfcaptureStrXml($char){
if($this->xml_string{($this->curs-1)}<>'<'){
if($this->xml_string[($this->curs-1)]<>'<'){
if($this->_position<>0){
$calc_item=str_repeat("__",$this->_position);
$this->_position--;
......@@ -148,7 +148,7 @@ extends crxFramework{
while( $this->curs < $xml_string_size ){
$cur_str = $this->xml_string{$this->curs};
$cur_str = $this->xml_string[$this->curs];
if($cur_str=='<'){
$this->startCaptureStrXml($cur_str);
......
......@@ -16,16 +16,14 @@
* GNU General Public License for more details.
*
@ Creation : 2012.
@ Update : 16 / 12 / 2019.
@ Update : 16 / 01 / 2020.
@ History : 11/2013: Migrate SQLITE 1 to SQLITE 3 with PDO
*************************************************************************************
*/
namespace crx;
class itemToSqlite{
function debugFile($d,$dump){
if($dump){
ob_start();
......@@ -250,7 +248,7 @@ class itemToSqlite{
$i=strlen($str)-$cursor;
$c=0;$str_=null;
while($c<$i){
$str_.=$str{$c};
$str_.=$str[$c];
$c++; //:)
}
return $str_;
......
......@@ -3,10 +3,10 @@
* CRX-FRAMEWORK
* @author Bastien Barbe
* @date 01/2005
* @revision 27/05/2019
* @revision 26/01/2020
* @module file
* @copyright see header
* @version 1.3.3-1
* @version 1.3.4-1
*/
namespace crx;
......@@ -14,22 +14,31 @@ namespace crx;
class crxFile{
var $_var_line = '';
function __construct(){
$this->IndexMode = false;
$this->disableMessage = false;
$this->OnlySmallPicture = false;
$this->path_upload = "";
$this->IDRefer = "";
}
static function sfileExist($file){
if(file_exists($file))return true;
return false;
}
function fileExist($file){
if(file_exists($file))return true;
return false;
}
function __construct(){
$this->IndexMode = false;
$this->disableMessage = false;
$this->OnlySmallPicture = false;
$this->path_upload = "";
$this->IDRefer = "";
}
static function fileList($d,$x){
$l=NULL;
foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?\crx\eregng($x.'$',$f):1))$l[]=$f;
return $l;
}
function getFileExt($file){
$f = pathinfo($path_conf.$file, PATHINFO_EXTENSION);
......@@ -99,7 +108,7 @@ class crxFile{
static function directoryIsWritable($path) {
if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
if ($path[strlen($path)-1]=='/') // recursively return a temporary file path
return self::directoryIsWritable($path.uniqid(mt_rand()).'.tmp');
else if (is_dir($path))
return self::directoryIsWritable($path.'/'.uniqid(mt_rand()).'.tmp');
......@@ -755,7 +764,8 @@ class crxFile{
}
}//End of Class
?>
......@@ -376,9 +376,14 @@ namespace crx;
//echo "detect new field: $v <br />";
$t=$this->c_db -> dbi -> Prefix.$this->_table;
/*var $_tableSchemaType = array('my_column' => array('type'=>'text')); */
$typesql='VARCHAR(255)';
if(isset($this->_tableSchemaType[$v])){$typesql=$this->_tableSchemaType[$v]['type'];}
if(isset($this->_tableSchemaType[$v])){
$typesql=$this->_tableSchemaType[$v]['type'];
}
$sql='ALTER TABLE `'.$t.'` ADD `'.$v.'` '.$typesql.' NULL DEFAULT NULL AFTER `'.$prec_field.'`';
$this->c_db -> execSql($sql);
//$message.="<br /><br />".$sql."<br />";
}
......
......@@ -57,7 +57,10 @@ class crxCountry{
static function returnCountryFlag($country_code='fr'){//en us it sp etc ...
$root_interface_flags='/public/html-app/common/flags';
$path_flag_gif = $root_interface_flags ."/". $country_code.'.gif';
return '<img border="0" width="18" height="12" src="'.$path_flag_gif.'"" />';
}
......
<?php
/**
* @author Bastien Barbe - CRX-FRAMEWORK
* @version 1.0
* @version 1.0-1
* @date 11/2018
* @revision 23/11/2018
* @revision 26/01/2020
* @module library
* @description This class is used to load composer project with simply
* set the lib source path :
*
* @description This class is used to load composer project or other,
* with simply set the lib source path :
* $p = _APPLI_MAIN_MODULES_PATH_.'dxclusterAiReport/php-ml-master/src';
* $ia = new crxLoaderForLib($p,'Phpml');
*
*/
namespace crx;
class crxLoaderForLib{
var $_path_root = '';
......@@ -38,7 +35,6 @@ class crxLoaderForLib{
function load( $class ){
if(empty($this->_file)){
if ($handle = opendir($this->_path_root)) {
while (false !== ($entry = readdir($handle))) {
......@@ -51,9 +47,7 @@ class crxLoaderForLib{
else{
if ($handleSub = opendir($this->_path_root.'/'.$entry)) {
while (false !== ($entrysub = readdir($handleSub))) {
if ($entrysub != "." && $entrysub != ".." && strtolower(substr($entrysub, strrpos($entrysub, '.') + 1)) == 'php') {
//echo "sub dir : $entry / $entrysub <br />";
if ($entrysub != "." && $entrysub != ".." && strtolower(substr($entrysub, strrpos($entrysub, '.') + 1)) == 'php') {
$f=explode('.',$entrysub);
$k=$f[0];
$php_file[$k]=$entry.'/'.$entrysub;
......@@ -64,6 +58,7 @@ class crxLoaderForLib{
}
}
closedir($handle);
//var_dump($class);
//var_dump($php_file);
......@@ -99,9 +94,14 @@ class crxLoaderForLib{
$o=str_replace($this->_ns,'',$class);
$o=str_replace('\\','/',$o);
$o=$o.'.php';
//remove first / from path :
$o=crxString::removeFirstCharOfString($o);
//remove first / from path if it start by /
if($o[0]=='/' || $o[0]=='\\')
$o=crxString::removeFirstCharOfString($o);
$include_path=$this->_path_root.'/'.$o;
//var_dump($include_path);
if(is_file($include_path) && file_exists($include_path)){
if($this->debug)echo 'INFO include class:'.$class."\n";
//var_dump($include_path);
......
<?php
// extends generic_crxItem
// v1.1 04/04/2019
// up 28/01/2020
namespace crx;
class abstractDxClusterSpot{
var $_debug_details = '';
var $_debug_details = '';
var $global_subbands_filtering_selected = array();
function setUserTargetContinent($u){
$this->_targetContinents=$u;
......@@ -135,7 +138,42 @@ class abstractDxClusterSpot{
if(isset($params['continent_dxspot_filtering_selected'])) $this->display_continent_dxspot_filtering_selected = $params['continent_dxspot_filtering_selected'];
if(isset($params['continent_spotter_filtering_selected'])) $this->display_continent_spotter_filtering_selected = $params['continent_spotter_filtering_selected'];
if(isset($params['global_subbands_filtering_selected'])) $this->global_subbands_filtering_selected = $params['global_subbands_filtering_selected'];//overide bands_filtering_selected
if(isset($params['bands_filtering_selected'])) $this->bands_filtering_selected = $params['bands_filtering_selected'];
$tmp=array();//remove _fsb prefix and create new array structure :
foreach($this->global_subbands_filtering_selected as $k=>$v){
$k=str_replace('fsb_','',$k);
$tmp[$k]=$k;
}
if(isset($tmp['id']))unset($tmp['id']);
$this->global_subbands_filtering_selected=$tmp;
if(!empty($this->global_subbands_filtering_selected)){
//var_dump($this->bands_filtering_selected);
}
/*
var_dump($this->global_subbands_filtering_selected);
array (size=3)
'cw' => string 'cw' (length=2)
'ssb' => string 'ssb' (length=3)
'fsb_cw' => int 1
'fsb_ssb' => int 1
*/
if(isset($params['filters_order_by'])) $this->display_filters_order_by = $params['filters_order_by'];
if(isset($params['filters_send_filter'])) $this->display_filters_send_filter = $params['filters_send_filter'];
......
<?php
/**
* @date 01/01/2005
* @revision 24/12/2019
* @revision 15/01/2020
* @lib radioamator
* @copyright see header
*/
......@@ -430,7 +430,7 @@ class dxClusterSpot11m extends abstractDxClusterSpot{
}
}
$bands=0;
if(is_array($this->bands_filtering_selected)){
$band_is_selected=0;
......
......@@ -78,12 +78,11 @@ class hamCountry{
//First we try to solve HAM callsign :
$spot_dxccid=$this->calcDxccSpiderID();
if($qso_date_time){
$this->setQsoDate($qso_date_time);
}
$this->_debug.='SELECT * FROM `crx_country` WHERE `country_id_dxspider` = '.$spot_dxccid.'';
$q='SELECT * FROM `crx_country` WHERE `country_id_dxspider` = '.$spot_dxccid.'';
......@@ -103,6 +102,11 @@ class hamCountry{
$s->setDbHandler(crxDataSource::getDs('mysql'));
$country_dx_prefix_11m = $s->callsign11mLookup($call);
$rs = $this->dxccLookupInformationFrom_country_prefix_11m($country_dx_prefix_11m);
if($this->debug && !empty($rs)){
echo "<br/><br/><u>Found 11m callsign</u><br />";
}
}
}
......@@ -881,7 +885,7 @@ class hamCountry{
if($this->debug){
echo "<br/><br/><u>Found result:</u><br />";
echo "<br />Dxspider country id is : <b>".$rs."</b><br />";
var_dump($this->getCountryInfoFromDxSpiderId($this->_dxcc_id));
//var_dump($this->getCountryInfoFromDxSpiderId($this->_dxcc_id));
}
return $rs;
......@@ -892,7 +896,9 @@ class hamCountry{
//IS DELETED SUPPORT
function dxccSpiderLookupInformation($dxcc_id){
$dxcc_id=(int)$dxcc_id;
$q='SELECT * FROM `crx_country` WHERE `country_id_dxspider` = '.$dxcc_id.'';
// AND `crx_country`.`country_is_deleted` <> 1
......
......@@ -3,9 +3,9 @@
* CRX-RADIO-CLOUD
* @author Bastien Barbe
* @creation date 11/2014
* @revision 24122019
* @revision 15012020
* @module dxClusterWeb,users/hamUser
* @version 0.1-2
* @version 0.2-1
*/
namespace crx;
class hamUser{
......@@ -31,7 +31,8 @@ class hamUser{
var $_table_users = 'cluster_users';
var $c_db = NULL;
var $reg_locator = '([A-Z]{2})([1-90-9]{2})([A-Za-z]{2})';
var $reg_locator = '([A-Za-z]{2})([1-90-9]{2})([A-Za-z]{2})';
var $reg_callsign_ham = '[A-Za-z1-90-9\/]{1,12}';
function __construct(){
......@@ -83,9 +84,15 @@ class hamUser{
'filter_key_value' => $uid
)
);
$this->c_db -> execSql();
$rs=$this->c_db->returnLine();
return $rs['country_id'];
if(isset($rs['country_id'])){
return $rs['country_id'];
}
}
function getLocator($callsign){
......
......@@ -643,7 +643,7 @@ frequency_default["0.7"]="435250";
),
'11m' => array(
'band' => array( 27000, 27900 ),
'band' => array( 25000, 27999 ),
'cw' => array( 27498, 27505 ),
'data' => array( 27685, 27850 ),
'ssb' => array( 27505, 27685 )
......@@ -746,7 +746,7 @@ frequency_default["0.7"]="435250";
'band' => array(165000, 174000)
),
'pmruhf' => array (
'band' => array(425000, 430000, 440000, 471000)
'band' => array(446000,447000,425000,440000)
)
);
......
......@@ -3,10 +3,10 @@
* CRX-FRAMEWORK
* @author Bastien Barbe
* @date 01/01/2005
* @revision R04042019
* @revision 26/01/2020
* @lib string
* @copyright see header
* @version 1.3
* @version 1.3-1
*/
namespace crx;
......@@ -50,7 +50,7 @@ class crxString{
$i=strlen($str)-$cursor;
$c=0;$str_=null;
while($c<$i){
$str_.=$str{$c};
$str_.=$str[$c];
$c++; //:)
}
return $str_;
......
......@@ -69,7 +69,7 @@ class crxPhpJavaScriptWrapper{
$js_line ="\r\n".'var '.$this->_js_array_args['array_js_name'].' = new Array();';
foreach($this->_js_array_args['array_php_input'] as $k=>$v){
if($this->_js_array_args['array_php_input_value_for_js'])
if(isset($this->_js_array_args['array_php_input_value_for_js']))
$js_line.=$this->_js_array_args['array_js_name'].'[\''.$k.'\']=\''.$v[$this->_js_array_args['array_php_input_value_for_js']].'\';'."\n";
else
$js_line.=$this->_js_array_args['array_js_name'].'[\''.$k.'\']=\''.$v.'\';'."\n";
......@@ -86,4 +86,4 @@ class crxPhpJavaScriptWrapper{
}
}
?>
\ No newline at end of file
?>
......@@ -23,6 +23,8 @@ class crxWebApplication extends crxDataXml{
parent::__construct();
// _REGISTRY_FOLDER_ => [root]/conf/conf-appli/
$this->_web_path_configuration = _REGISTRY_FOLDER_ . 'website.conf.xml';
$this->_web_langs_availables = _REGISTRY_FOLDER_ . 'languages.xml';
......
......@@ -3,10 +3,10 @@
* CRX-FRAMEWORK
* @author Bastien Barbe
* @date 01/01/2005
* @revision 07/06/2019
* @revision 29/01/2020
* @crx-core classes
* @copyright see header
* @version 1.2.3-2
* @version 1.2.4-2
*/
namespace crx;
......@@ -34,6 +34,7 @@ if (!function_exists('mysql_connect')){
function mysql_insert_id($resource = null){return mysqli_insert_id($resource);}
function mysql_fetch_assoc($resource = null){return mysqli_fetch_assoc($resource);}
}
/**
* Executes multiple queries in a 'bulk' to achieve better
* performance and integrity.
......@@ -46,7 +47,7 @@ if (!function_exists('mysql_connect')){
function mysqlBulk(&$data, $table, $method = 'transaction', $options = array()) {
$_item_ceiling = 300;
$_debug = 1;
$_debug = 0;
////CRXADD//////
if (isset($options['crx_task_monitor_handler'])) {
$_item_ceiling = $options['crx_task_monitor_item_ceiling'];
......@@ -325,10 +326,8 @@ function mysqlBulk(&$data, $table, $method = 'transaction', $options = array())
}
class dbDriver extends crxDataSource{
var $_debug = false;
var $dataInstance = NULL;
......@@ -380,13 +379,9 @@ class dbDriver extends crxDataSource{
return ' varchar(256) ';
}
}
function getNotNull($n,$is_pk=false){
if($is_pk){
......@@ -505,10 +500,25 @@ class dbDriver extends crxDataSource{
function secureStr($str){
return mysql_real_escape_string($str,$this->dataInstance);
$out=mysql_real_escape_string($str,$this->dataInstance);