Skip to content

Commit

Permalink
fix group user permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
callcenter-magnus committed Dec 28, 2023
1 parent 236e037 commit a1db44a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 24 deletions.
Binary file modified build/MagnusBilling-current.tar.gz
Binary file not shown.
20 changes: 15 additions & 5 deletions protected/commands/PortabilidadeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,35 @@ public function run($args)
public function checkDID($args)
{

$arrContextOptions = [
"ssl" => [
"verify_peer" => false,
"verify_peer_name" => false,
],
];

$modelDid = Did::model()->findAll();

foreach ($modelDid as $key => $did) {

$url = "https://consultas.portabilidadecelular.com/painel/consulta_numero.php?user=" . $args[0] . "&pass=" . $args[1] . "&seache_number=" . $did->did . "&completo";
if ( ! $result = @file_get_contents($url, false)) {

if ( ! $result = @file_get_contents($url, false, stream_context_create($arrContextOptions))) {

$did->country = 'Operadora não identificada';
} else {
$res = preg_split('/\|/', $result);
}

if ( ! isset($res[1])) {
print_r($result);
continue;
}

if ($res == 55998) {
$did->country = 'Sem crédito';
} else {

if ( ! isset($res[1])) {
print_r($result);
continue;
}
if ($res[1]) {
$did->country = $res[3] . ' ' . $res[2];
} else {
Expand Down
12 changes: 6 additions & 6 deletions protected/components/CCJSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public static function encode($var)
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
$ascii .= '\\' . $var{$c}
$ascii .= '\\' . $var{$c};
break;

case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $var{$c}
$ascii .= $var{$c};
break;

case (($ord_var_c & 0xE0) == 0xC0):
Expand Down Expand Up @@ -152,19 +152,19 @@ public static function encode($var)
// treat as a JSON object
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
return '{' .
join(',', array_map(['CJSON', 'nameValue'],
join(',', array_map(array('CJSON', 'nameValue'),
array_keys($var),
array_values($var)))
. '}';
}

// treat it like a regular array
return '[' . join(',', array_map(['CJSON', 'encode'], $var)) . ']';
return '[' . join(',', array_map(array('CJSON', 'encode'), $var)) . ']';

case 'object':
if ($var instanceof Traversable) {
$var = get_parent_class($var) === 'Model' ? $var->getAttributes() : $var;
$vars = [];
$vars = array();
foreach ($var as $k => $v) {
$vars[$k] = $v;
}
Expand All @@ -174,7 +174,7 @@ public static function encode($var)
}

return '{' .
join(',', array_map(['CJSON', 'nameValue'],
join(',', array_map(array('CJSON', 'nameValue'),
array_keys($vars),
array_values($vars)))
. '}';
Expand Down
26 changes: 13 additions & 13 deletions protected/controllers/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class ModuleController extends Controller
public $defaultSort = null;
public $defaultSortDir = null;
public $fixedWhere = null;
public $extraValues = array('idModule' => 'text');
public $extraValues = ['idModule' => 'text'];

public $attributeOrder = 't.id_module ASC, priority ASC';
public $titleReport = 'Module';
public $subTitleReport = 'Module';
public $rendererReport = array(
public $rendererReport = [
'id_module' => 'idModuletext',
);
];

public function init()
{
Expand All @@ -53,23 +53,23 @@ public function actionReadTree()

private function getModuleTree($modules)
{
$result = array();
$result = [];

foreach ($modules as $model) {

if (empty($model['id_module'])) {
$childs = $this->getSubModuleTree($modules, $model['id']);

array_push($result, array(
array_push($result, [
'id' => $model['id'],
'text' => $model['text'],
'iconCls' => $model['icon_cls'],
'id_module' => $model['id_module'],
'rows' => $childs,
'checked' => false,
'expanded' => $model['id'] == 1 ? true : false,
'leaf' => !count($childs),
));
'leaf' => ! count($childs),
]);
}
}

Expand All @@ -79,29 +79,29 @@ private function getModuleTree($modules)
private function getSubModuleTree($modules, $idOwner)
{
$subModulesOwner = Util::arrayFindByProperty($modules, 'id_module', $idOwner);
$result = array();
$result = [];

foreach ($subModulesOwner as $model) {
if (!empty($model['id_module'])) {
array_push($result, array(
if ( ! empty($model['id_module'])) {
array_push($result, [
'id' => $model['id'],
'text' => $model['text'],
'iconCls' => $model['icon_cls'],
'id_module' => $model['id_module'],
'module' => $model['module'],
'checked' => false,
'leaf' => true,
));
]);
} else {
array_push($result, array(
array_push($result, [
'id' => $model['id'],
'text' => $model['text'],
'iconCls' => $model['icon_cls'],
'id_module' => $model['id_module'],
'rows' => $this->getSubModuleTree($modules, $model['id']),
'checked' => false,
'expanded' => true,
));
]);
}
}

Expand Down

0 comments on commit a1db44a

Please sign in to comment.