Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ZAKI RAIHAN
1606878505_ossd_telegram_notif_bot
Commits
70b5dc27
Commit
70b5dc27
authored
Sep 26, 2019
by
zakiraihan
Browse files
add procfile to deploy on heroku, create sso login example
parent
551347b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Procfile
0 → 100644
View file @
70b5dc27
web: gunicorn app:app
app.py
View file @
70b5dc27
...
@@ -3,7 +3,7 @@ import requests
...
@@ -3,7 +3,7 @@ import requests
import
telegram
import
telegram
import
urllib.parse
import
urllib.parse
from
flask
import
Flask
,
request
from
flask
import
Flask
,
request
,
render_template
from
flask_sqlalchemy
import
SQLAlchemy
from
flask_sqlalchemy
import
SQLAlchemy
global
bot
global
bot
...
@@ -58,6 +58,10 @@ def sendNotif():
...
@@ -58,6 +58,10 @@ def sendNotif():
r
=
requests
.
get
(
url
=
url
)
r
=
requests
.
get
(
url
=
url
)
return
r
.
json
()
return
r
.
json
()
@
app
.
route
(
'/loginsso'
,
methods
=
[
'GET'
])
def
renderLoginSSOPage
():
return
render_template
(
'loginSSO.html'
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
app
.
run
(
threaded
=
True
)
app
.
run
(
threaded
=
True
)
\ No newline at end of file
templates/loginSSO.html
0 → 100644
View file @
70b5dc27
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
content=
'width=device-width, initial-scale=1'
name=
'viewport'
/>
<meta
http-equiv=
"content-type"
content=
"text/html; charset=UTF-8"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
/>
<title>
Login Fasilkom Telegram Bot
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://sso.ui.ac.id/cas/themes/ui/bootstrap.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://sso.ui.ac.id/cas/themes/ui/sso.css"
/>
<link
rel=
"icon"
href=
"https://sso.ui.ac.id/cas/themes/ui/logo2_0.gif"
type=
"image/x-icon"
/>
</head>
<body>
<div
class=
"container"
>
<div
class=
"main"
>
<div
class=
"bg"
></div>
<div
class=
"login-box"
>
<form
id=
"fm1"
class=
"login"
action=
"/cas/login"
method=
"post"
>
<div
class=
"top"
>
<div
class=
"pull-right"
><img
src=
"https://sso.ui.ac.id/cas/themes/ui/logo.png"
/></div>
<h1>
SSO
</h1>
<div
class=
"sub"
>
Single Sign On
</div>
</div>
<div
class=
"middle"
>
<p>
Masukkan username dan password UI Anda/
<br
/><em>
Enter your username and password
</em>
:
</p>
<div
class=
"form-group"
>
<input
id=
"username"
name=
"username"
class=
"form-control"
placeholder=
"Username"
type=
"text"
value=
""
autocomplete=
"false"
/>
</div>
<div
class=
"form-group"
>
<input
id=
"password"
name=
"password"
class=
"form-control"
placeholder=
"Password"
type=
"password"
value=
""
autocomplete=
"off"
/>
</div>
</div>
<input
type=
"hidden"
name=
"lt"
value=
"LT-103348-2cBkKRmmrCOb0xQdqc2hsTP2mdULjL"
/>
<input
type=
"hidden"
name=
"execution"
value=
"e2s1"
/>
<input
type=
"hidden"
name=
"_eventId"
value=
"submit"
/>
<div
class=
"bottom clearfix"
>
<div
class=
"pull-right"
style=
"margin-top:12px"
>
<button
type=
"submit"
class=
"btn btn-lg btn-primary"
>
Login
</button>
</div>
<table>
<tr>
<!--
<td style="padding: 10px 10px 10px 10px;">
<div class="help"><a href="#">Lupa password<br /><em>Forget password</em></a></div>
</td>
-->
<td
style=
"padding: 0px 10px 10px 10px;"
>
<div
class=
"help"
><a
href=
"/account/user/register"
>
Daftar Akun
<br
/><em>
Guest Account
</em></a></div>
</td>
<td
style=
"border-left: solid #D5D5D5; "
>
</td>
<td
style=
"padding: 0px 0px 10px 10px;"
>
<div
class=
"help"
><a
href=
"/account/static/frequently-asked-question-faq"
>
Butuh Bantuan ?
<br
/><em>
Need Help ?
</em></a></div>
</td>
</tr>
</table>
</div>
</form>
</div>
<script
type=
"text/javascript"
>
function
hasError
(
input
)
{
if
(
input
&&
/has-error/
.
test
(
input
.
parentElement
.
className
))
return
input
;
}
function
isEmpty
(
input
)
{
if
(
input
&&
input
.
value
==
""
)
return
input
;
}
var
u
=
document
.
getElementById
(
"
username
"
);
var
p
=
document
.
getElementById
(
"
password
"
);
var
candidates
=
[
hasError
(
u
),
hasError
(
p
),
isEmpty
(
u
),
isEmpty
(
p
),
u
];
for
(
var
i
=
0
;
i
<
candidates
.
length
;
++
i
)
{
if
(
candidates
[
i
])
{
candidates
[
i
].
focus
();
break
;
}
}
</script>
</body>
</html>
Write
Preview
Supports
Markdown
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