Skip to content

Commit 02779da

Browse files
fix group user permissions
1 parent 236e037 commit 02779da

File tree

4 files changed

+34
-24
lines changed

4 files changed

+34
-24
lines changed

build/MagnusBilling-current.tar.gz

160 Bytes
Binary file not shown.

protected/commands/PortabilidadeCommand.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,35 @@ public function run($args)
8585
public function checkDID($args)
8686
{
8787

88+
$arrContextOptions = [
89+
"ssl" => [
90+
"verify_peer" => false,
91+
"verify_peer_name" => false,
92+
],
93+
];
94+
8895
$modelDid = Did::model()->findAll();
8996

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

9299
$url = "https://consultas.portabilidadecelular.com/painel/consulta_numero.php?user=" . $args[0] . "&pass=" . $args[1] . "&seache_number=" . $did->did . "&completo";
93-
if ( ! $result = @file_get_contents($url, false)) {
100+
101+
if ( ! $result = @file_get_contents($url, false, stream_context_create($arrContextOptions))) {
102+
94103
$did->country = 'Operadora não identificada';
95104
} else {
96105
$res = preg_split('/\|/', $result);
97106
}
98107

108+
if ( ! isset($res[1])) {
109+
print_r($result);
110+
continue;
111+
}
112+
99113
if ($res == 55998) {
100114
$did->country = 'Sem crédito';
101115
} else {
102116

103-
if ( ! isset($res[1])) {
104-
print_r($result);
105-
continue;
106-
}
107117
if ($res[1]) {
108118
$did->country = $res[3] . ' ' . $res[2];
109119
} else {

protected/components/CCJSON.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ public static function encode($var)
5959
case $ord_var_c == 0x2F:
6060
case $ord_var_c == 0x5C:
6161
// double quote, slash, slosh
62-
$ascii .= '\\' . $var{$c}
62+
$ascii .= '\\' . $var{$c};
6363
break;
6464

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

7070
case (($ord_var_c & 0xE0) == 0xC0):
@@ -152,19 +152,19 @@ public static function encode($var)
152152
// treat as a JSON object
153153
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
154154
return '{' .
155-
join(',', array_map(['CJSON', 'nameValue'],
155+
join(',', array_map(array('CJSON', 'nameValue'),
156156
array_keys($var),
157157
array_values($var)))
158158
. '}';
159159
}
160160

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

164164
case 'object':
165165
if ($var instanceof Traversable) {
166166
$var = get_parent_class($var) === 'Model' ? $var->getAttributes() : $var;
167-
$vars = [];
167+
$vars = array();
168168
foreach ($var as $k => $v) {
169169
$vars[$k] = $v;
170170
}
@@ -174,7 +174,7 @@ public static function encode($var)
174174
}
175175

176176
return '{' .
177-
join(',', array_map(['CJSON', 'nameValue'],
177+
join(',', array_map(array('CJSON', 'nameValue'),
178178
array_keys($vars),
179179
array_values($vars)))
180180
. '}';

protected/controllers/ModuleController.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ class ModuleController extends Controller
2525
public $defaultSort = null;
2626
public $defaultSortDir = null;
2727
public $fixedWhere = null;
28-
public $extraValues = array('idModule' => 'text');
28+
public $extraValues = ['idModule' => 'text'];
2929

3030
public $attributeOrder = 't.id_module ASC, priority ASC';
3131
public $titleReport = 'Module';
3232
public $subTitleReport = 'Module';
33-
public $rendererReport = array(
33+
public $rendererReport = [
3434
'id_module' => 'idModuletext',
35-
);
35+
];
3636

3737
public function init()
3838
{
@@ -53,23 +53,23 @@ public function actionReadTree()
5353

5454
private function getModuleTree($modules)
5555
{
56-
$result = array();
56+
$result = [];
5757

5858
foreach ($modules as $model) {
5959

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

63-
array_push($result, array(
63+
array_push($result, [
6464
'id' => $model['id'],
6565
'text' => $model['text'],
6666
'iconCls' => $model['icon_cls'],
6767
'id_module' => $model['id_module'],
6868
'rows' => $childs,
6969
'checked' => false,
7070
'expanded' => $model['id'] == 1 ? true : false,
71-
'leaf' => !count($childs),
72-
));
71+
'leaf' => ! count($childs),
72+
]);
7373
}
7474
}
7575

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

8484
foreach ($subModulesOwner as $model) {
85-
if (!empty($model['id_module'])) {
86-
array_push($result, array(
85+
if ( ! empty($model['id_module'])) {
86+
array_push($result, [
8787
'id' => $model['id'],
8888
'text' => $model['text'],
8989
'iconCls' => $model['icon_cls'],
9090
'id_module' => $model['id_module'],
9191
'module' => $model['module'],
9292
'checked' => false,
9393
'leaf' => true,
94-
));
94+
]);
9595
} else {
96-
array_push($result, array(
96+
array_push($result, [
9797
'id' => $model['id'],
9898
'text' => $model['text'],
9999
'iconCls' => $model['icon_cls'],
100100
'id_module' => $model['id_module'],
101101
'rows' => $this->getSubModuleTree($modules, $model['id']),
102102
'checked' => false,
103103
'expanded' => true,
104-
));
104+
]);
105105
}
106106
}
107107

0 commit comments

Comments
 (0)