Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
175
Issues
175
List
Boards
Labels
Service Desk
Milestones
Merge Requests
41
Merge Requests
41
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
9d796baa
Commit
9d796baa
authored
2 hours ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): Query issues; (chore): Tweak response
parent
9378e291
epic/minds-pro
1 merge request
!281
WIP: (feat): Minds Pro
Pipeline
#72478041
passed with stages
in 11 minutes and 6 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
11 deletions
+34
-11
pro.php
Controllers/api/v2/pro.php
+29
-8
InitializeValuesDelegate.php
Core/Pro/Delegates/InitializeValuesDelegate.php
+3
-1
Repository.php
Core/Pro/Repository.php
+2
-2
No files found.
Controllers/api/v2/pro.php
View file @
9d796baa
...
...
@@ -29,7 +29,8 @@ class pro implements Interfaces\Api
->
setUser
(
Session
::
getLoggedinUser
());
return
Factory
::
response
([
'active'
=>
$manager
->
isActive
()
'isActive'
=>
$manager
->
isActive
(),
/* TODO: Send values */
]);
}
...
...
@@ -45,11 +46,26 @@ class pro implements Interfaces\Api
$manager
->
setUser
(
Session
::
getLoggedinUser
());
$success
=
$manager
->
enable
(
time
()
+
(
365
*
86400
));
switch
(
$pages
[
0
])
{
case
'enable'
:
// TODO: Send and process payment data
$success
=
$manager
->
enable
(
time
()
+
(
365
*
86400
));
return
Factory
::
response
([
'done'
=>
$success
,
]);
if
(
!
$success
)
{
return
Factory
::
response
([
'status'
=>
'error'
,
'message'
=>
'Error activating Pro'
,
]);
}
return
Factory
::
response
([
/* TODO: Send values */
]);
default
:
return
Factory
::
response
([
'status'
=>
'error'
,
'message'
=>
'Unknown method'
]);
}
}
/**
...
...
@@ -76,8 +92,13 @@ class pro implements Interfaces\Api
$success
=
$manager
->
disable
();
return
Factory
::
response
([
'done'
=>
$success
,
]);
if
(
!
$success
)
{
return
Factory
::
response
([
'status'
=>
'error'
,
'message'
=>
'Error disabling Pro'
,
]);
}
return
Factory
::
response
([]);
}
}
This diff is collapsed.
Click to expand it.
Core/Pro/Delegates/InitializeValuesDelegate.php
View file @
9d796baa
...
...
@@ -39,10 +39,12 @@ class InitializeValuesDelegate
if
(
!
$values
)
{
$values
=
new
Values
();
$values
->
setUserGuid
(
$user
->
guid
);
}
if
(
!
$values
->
getDomain
())
{
$values
->
setDomain
(
"pro-
{
$user
->
username
}
.minds.com"
);
$values
->
setDomain
(
"pro-
{
$user
->
guid
}
.minds.com"
);
}
$this
->
repository
...
...
This diff is collapsed.
Click to expand it.
Core/Pro/Repository.php
View file @
9d796baa
...
...
@@ -49,11 +49,11 @@ class Repository
$cqlOpts
=
[];
if
(
$opts
[
'user_guid'
])
{
$where
.
=
'user_guid = ?'
;
$where
[]
=
'user_guid = ?'
;
$values
[]
=
new
Bigint
(
$opts
[
'user_guid'
]);
}
elseif
(
$opts
[
'domain'
])
{
$cql
=
"SELECT * FROM pro_by_domain"
;
$where
=
'domain = ?'
;
$where
[]
=
'domain = ?'
;
$values
[]
=
$opts
[
'domain'
];
}
...
...
This diff is collapsed.
Click to expand it.
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