Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UCommWebforms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Experience Group
UCommWebforms
Commits
659a7666
Commit
659a7666
authored
Apr 27, 2011
by
Eric Rasmussen
Browse files
Options
Downloads
Patches
Plain Diff
Add results page requiring login to view
parent
5acc5809
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config-police-terrex11.sample.php
+11
-2
11 additions, 2 deletions
config-police-terrex11.sample.php
www/police/terrex11/results.php
+46
-0
46 additions, 0 deletions
www/police/terrex11/results.php
with
57 additions
and
2 deletions
config-police-terrex11.sample.php
+
11
−
2
View file @
659a7666
...
@@ -2,14 +2,23 @@
...
@@ -2,14 +2,23 @@
ini_set
(
'display_errors'
,
true
);
ini_set
(
'display_errors'
,
true
);
// Sample configuration file for the ucomm webforms project
// Sample configuration file for the ucomm webforms project
set_include_path
(
dirname
(
__FILE__
)
.
'/lib/php/'
.
PATH_SEPARATOR
.
get_include_path
());
set_include_path
(
dirname
(
__FILE__
)
.
'/lib/php/'
.
PATH_SEPARATOR
.
get_include_path
());
/*
$con
=
mysql_connect
(
"localhost"
,
"test"
,
"test"
);
$con
=
mysql_connect
(
"localhost"
,
"test"
,
"test"
);
if
(
!
$con
){
if
(
!
$con
){
die
(
'Could not connect: '
.
mysql_error
());
die
(
'Could not connect: '
.
mysql_error
());
}
else
{
}
else
{
mysql_select_db
(
"police_terrex11"
,
$con
);
mysql_select_db
(
"police_terrex11"
,
$con
);
}
}
/**
* CREATE TABLE IF NOT EXISTS `registration` (
* `id` int(11) NOT NULL AUTO_INCREMENT,
* `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
* `name` varchar(255) NOT NULL,
* `email` varchar(255) NOT NULL,
* PRIMARY KEY (`id`)
* ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
*/
*/
function
myautoload
(
$class
)
function
myautoload
(
$class
)
{
{
$file
=
str_replace
(
'_'
,
'/'
,
$class
)
.
'.php'
;
$file
=
str_replace
(
'_'
,
'/'
,
$class
)
.
'.php'
;
...
...
This diff is collapsed.
Click to expand it.
www/police/terrex11/results.php
0 → 100644
+
46
−
0
View file @
659a7666
<?php
if
(
file_exists
(
dirname
(
__FILE__
)
.
'/../../../config-police-terrex11.inc.php'
))
{
require_once
dirname
(
__FILE__
)
.
'/../../../config-police-terrex11.inc.php'
;
}
else
{
require_once
dirname
(
__FILE__
)
.
'/../../../config-police-terrex11.sample.php'
;
}
require_once
'UNL/Auth.php'
;
$cas_client
=
UNL_Auth
::
factory
(
'SimpleCAS'
);
if
(
isset
(
$_GET
[
'login'
]))
{
$cas_client
->
login
();
}
if
(
isset
(
$_GET
[
'logout'
]))
{
$cas_client
->
logout
();
}
if
(
$cas_client
->
isLoggedIn
()
&&
in_array
(
$cas_client
->
getUser
(),
array
(
'bbenson2'
,
'erasmussen2'
)))
{
?>
You are logged in -
<a
href=
"?logout"
>
Logout
</a>
<br><br>
<table>
<?php
$result
=
mysql_query
(
'SELECT * from registration'
);
if
(
!
$result
)
{
die
(
'Invalid query: '
.
mysql_error
());
}
while
(
$row
=
mysql_fetch_assoc
(
$result
))
{
echo
'<tr><td style="padding-right:20px">'
.
$row
[
'name'
]
.
'</td><td style="padding-right:20px">'
.
$row
[
'email'
]
.
'</td><td>'
.
$row
[
'time'
]
.
'</td></tr>'
;
}
?>
</table>
<?php
}
else
if
(
$cas_client
->
isLoggedIn
()
&&
!
in_array
(
$cas_client
->
getUser
(),
array
(
'bbenson2'
,
'erasmussen2'
)))
{
?>
You are not authorized
<?php
}
else
{
?>
<a
href=
"?login"
>
Login
</a>
<?php
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment