Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smsManager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
smsManager
Commits
77a242fc
Commit
77a242fc
authored
Jun 06, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correccion digito verificador
parent
6ca25d59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
58 deletions
+71
-58
src/AppBundle/Model/UsuarioMcafee.php
src/AppBundle/Model/UsuarioMcafee.php
+71
-58
No files found.
src/AppBundle/Model/UsuarioMcafee.php
View file @
77a242fc
...
...
@@ -6,114 +6,127 @@ use AppBundle\Model\om\BaseUsuarioMcafee;
use
AppBundle\Lib\Crypt
;
use
AppBundle\Lib\Utiles
;
class
UsuarioMcafee
extends
BaseUsuarioMcafee
{
const
ELIMINADO_TRUE
=
TRUE
;
const
ELIMINADO_FALSE
=
FALSE
;
class
UsuarioMcafee
extends
BaseUsuarioMcafee
{
const
ELIMINADO_TRUE
=
TRUE
;
const
ELIMINADO_FALSE
=
FALSE
;
const
ACTIVO_MOVISTAR_TRUE
=
TRUE
;
const
ACTIVO_MOVISTAR_FALSE
=
FALSE
;
const
TIPO_MULTIDEVICE
=
1
;
const
TIPO_ANTIVIRUS
=
2
;
const
SECRET
=
"mcafeemov39293bjds8"
;
const
SECRET
=
"mcafeemov39293bjds8"
;
public
function
generarUsuarioEncriptadoParaMovistar
()
{
$crypt
=
new
Crypt
();
$crypt
->
key
=
self
::
SECRET
;
$strAencriptar
=
$this
->
getUmcMcafeeCcid
()
.
"|"
.
$this
->
getUmcMcafeeEmail
();
$strAencriptar
=
$this
->
getUmcMcafeeCcid
()
.
"|"
.
$this
->
getUmcMcafeeEmail
();
//print_r($strAencriptar);
return
Utiles
::
base64url_encode
(
$crypt
->
AES_Encode
(
$strAencriptar
));
}
public
function
getTipoServicio
(){
if
(
$this
->
getUmcMcafeeTipoProducto
()
==
self
::
TIPO_MULTIDEVICE
)
{
public
function
getTipoServicio
()
{
if
(
$this
->
getUmcMcafeeTipoProducto
()
==
self
::
TIPO_MULTIDEVICE
)
{
return
"Servicio Multi-Dispositivo"
;
}
else
{
}
else
{
return
"Servicio Antivirus"
;
}
}
/**
*
* @param type $str
* @param type $log
* @return type
*/
public
static
function
descencriptarUsuarioDesdeMovistar
(
$str
,
$log
)
{
public
static
function
descencriptarUsuarioDesdeMovistar
(
$str
,
$log
)
{
$crypt
=
new
Crypt
();
$crypt
->
key
=
self
::
SECRET
;
$strDes
=
$crypt
->
AES_Decode
(
Utiles
::
base64url_decode
(
$str
));
$strDes
=
$crypt
->
AES_Decode
(
Utiles
::
base64url_decode
(
$str
));
$log
->
debug
(
$strDes
);
if
(
$strDes
==
null
||
$strDes
==
''
)
if
(
$strDes
==
null
||
$strDes
==
''
)
return
null
;
list
(
$mcafeeCcid
,
$mcafeeEmail
)
=
explode
(
'|'
,
$strDes
);
if
(
$mcafeeCcid
==
''
||
$mcafeeEmail
==
""
)
list
(
$mcafeeCcid
,
$mcafeeEmail
)
=
explode
(
'|'
,
$strDes
);
if
(
$mcafeeCcid
==
''
||
$mcafeeEmail
==
""
)
return
null
;
return
UsuarioMcafeeQuery
::
create
()
->
filterByUmcMcafeeCcid
(
$mcafeeCcid
)
->
filterByUmcMcafeeEmail
(
$mcafeeEmail
)
->
findOne
();
->
filterByUmcMcafeeCcid
(
$mcafeeCcid
)
->
filterByUmcMcafeeEmail
(
$mcafeeEmail
)
->
findOne
();
}
public
function
generarUsuarioEncriptadoParaMovistarNuevo
()
{
$strAencriptar
=
$this
->
getUmcMcafeeCcid
()
.
"|"
.
$this
->
getUmcMcafeeEmail
();
$strAencriptar
=
$this
->
getUmcMcafeeCcid
()
.
"|"
.
$this
->
getUmcMcafeeEmail
();
//print_r($strAencriptar);
return
Utiles
::
base64url_encode
(
$strAencriptar
);
}
public
static
function
descencriptarUsuarioDesdeMovistarNuevo
(
$str
,
$log
)
{
$strDes
=
Utiles
::
base64url_decode
(
$str
);
public
static
function
descencriptarUsuarioDesdeMovistarNuevo
(
$str
,
$log
)
{
$strDes
=
Utiles
::
base64url_decode
(
$str
);
//$log->debug($strDes);
if
(
$strDes
==
null
||
$strDes
==
''
)
if
(
$strDes
==
null
||
$strDes
==
''
)
return
null
;
@
list
(
$mcafeeCcid
,
$mcafeeEmail
)
=
explode
(
'|'
,
$strDes
);
if
(
$mcafeeCcid
==
''
||
$mcafeeEmail
==
""
)
@
list
(
$mcafeeCcid
,
$mcafeeEmail
)
=
explode
(
'|'
,
$strDes
);
if
(
$mcafeeCcid
==
''
||
$mcafeeEmail
==
""
)
return
null
;
return
UsuarioMcafeeQuery
::
create
()
->
filterByUmcMcafeeCcid
(
$mcafeeCcid
)
->
filterByUmcMcafeeEmail
(
$mcafeeEmail
)
->
findOne
();
->
filterByUmcMcafeeCcid
(
$mcafeeCcid
)
->
filterByUmcMcafeeEmail
(
$mcafeeEmail
)
->
findOne
();
}
public
function
isTrakingDescarga
()
{
$count
=
TrackingQuery
::
create
()
->
filterByUmcId
(
$this
->
getUmcId
())
->
filterByTraTipo
(
Tracking
::
TIPO_DESCARGA
)
->
filterByTraEliminado
(
Tracking
::
ELIMINADO_FALSE
)
->
count
();
if
(
$count
>
0
)
{
if
(
$count
>
0
)
{
return
true
;
}
else
{
}
else
{
return
false
;
}
}
public
function
isEmailMovistarCorrecto
()
{
if
(
!
filter_var
(
$this
->
getUmcMovistarEmail
(),
FILTER_VALIDATE_EMAIL
))
{
if
(
!
filter_var
(
$this
->
getUmcMovistarEmail
(),
FILTER_VALIDATE_EMAIL
))
{
return
false
;
}
else
{
}
else
{
return
true
;
}
}
public
function
getDv
(){
$s
=
1
;
for
(
$m
=
0
;
$r
!=
0
;
$r
/=
10
)
$s
=
(
$s
+
$r
%
10
*
(
9
-
$m
++%
6
))
%
11
;
return
chr
(
$s
?
$s
+
47
:
75
);
public
function
getDv
()
{
$x
=
2
;
$sumatorio
=
0
;
for
(
$i
=
strlen
(
$rut
)
-
1
;
$i
>
0
;
$i
--
)
{
if
(
$x
>
7
)
{
$x
=
2
;
}
$sumatorio
=
$sumatorio
+
(
$rut
[
$i
]
*
$x
);
$x
++
;
}
$digito
=
bcmod
(
$sumatorio
,
11
);
$digito
=
11
-
$digito
;
switch
(
$digito
)
{
case
10
:
$digito
=
"K"
;
break
;
case
11
:
$digito
=
"0"
;
break
;
}
return
$digito
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment