Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
5dc65822
Commit
5dc65822
authored
Aug 04, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use email when it is a guest user.
parent
9d6f9097
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
28 deletions
+47
-28
www/aptui/activity.php
www/aptui/activity.php
+10
-3
www/aptui/profile-activity.php
www/aptui/profile-activity.php
+37
-25
No files found.
www/aptui/activity.php
View file @
5dc65822
...
@@ -49,23 +49,25 @@ $instances = array();
...
@@ -49,23 +49,25 @@ $instances = array();
#
#
$query1_result
=
$query1_result
=
DBQueryFatal
(
"select i.uuid,i.profile_version,i.created,'' as destroyed, "
.
DBQueryFatal
(
"select i.uuid,i.profile_version,i.created,'' as destroyed, "
.
" i.creator,p.uuid as profile_uuid,p.name,p.pid "
.
" i.creator,p.uuid as profile_uuid,p.name,p.pid
,u.email
"
.
" from apt_instances as i "
.
" from apt_instances as i "
.
"left join apt_profile_versions as p on "
.
"left join apt_profile_versions as p on "
.
" p.profileid=i.profile_id and "
.
" p.profileid=i.profile_id and "
.
" p.version=i.profile_version "
.
" p.version=i.profile_version "
.
"left join geni.geni_users as u on u.uuid=i.creator_uuid "
.
"order by i.created desc"
);
"order by i.created desc"
);
$query2_result
=
$query2_result
=
DBQueryFatal
(
"select h.uuid,h.profile_version,h.created,h.destroyed, "
.
DBQueryFatal
(
"select h.uuid,h.profile_version,h.created,h.destroyed, "
.
" h.creator,p.uuid as profile_uuid,p.name,p.pid "
.
" h.creator,p.uuid as profile_uuid,p.name,p.pid
,u.email
"
.
" from apt_instance_history as h "
.
" from apt_instance_history as h "
.
"left join apt_profile_versions as p on "
.
"left join apt_profile_versions as p on "
.
" p.profileid=h.profile_id and "
.
" p.profileid=h.profile_id and "
.
" p.version=h.profile_version "
.
" p.version=h.profile_version "
.
"left join geni.geni_users as u on u.uuid=h.creator_uuid "
.
"order by h.created desc"
);
"order by h.created desc"
);
if
(
mysql_num_rows
(
$query1_result
)
==
0
&&
if
(
mysql_num_rows
(
$query1_result
)
==
0
&&
mysql_num_rows
(
$query
1
_result
)
==
0
)
{
mysql_num_rows
(
$query
2
_result
)
==
0
)
{
$message
=
"<b>Oops, there is no activity to show you.</b><br>"
;
$message
=
"<b>Oops, there is no activity to show you.</b><br>"
;
SPITUSERERROR
(
$message
);
SPITUSERERROR
(
$message
);
exit
();
exit
();
...
@@ -81,6 +83,11 @@ foreach (array($query1_result, $query2_result) as $query_result) {
...
@@ -81,6 +83,11 @@ foreach (array($query1_result, $query2_result) as $query_result) {
$created
=
$row
[
"created"
];
$created
=
$row
[
"created"
];
$destroyed
=
$row
[
"destroyed"
];
$destroyed
=
$row
[
"destroyed"
];
$creator
=
$row
[
"creator"
];
$creator
=
$row
[
"creator"
];
$email
=
$row
[
"email"
];
# If a guest user, use email instead.
if
(
isset
(
$email
))
{
$creator
=
$email
;
}
$instance
=
array
();
$instance
=
array
();
$instance
[
"uuid"
]
=
$uuid
;
$instance
[
"uuid"
]
=
$uuid
;
...
...
www/aptui/profile-activity.php
View file @
5dc65822
...
@@ -57,37 +57,48 @@ $instances = array();
...
@@ -57,37 +57,48 @@ $instances = array();
#
#
# First existing instances and then the history table.
# First existing instances and then the history table.
#
#
$query_result
=
$query
1
_result
=
DBQueryFatal
(
"
(
select i.uuid,i.profile_version,i.created,'' as destroyed, "
.
DBQueryFatal
(
"select i.uuid,i.profile_version,i.created,'' as destroyed, "
.
" i.creator,p.uuid as profile_uuid "
.
" i.creator,p.uuid as profile_uuid
,u.email
"
.
" from apt_instances as i "
.
" from apt_instances as i "
.
"left join apt_profile_versions as p on "
.
"left join apt_profile_versions as p on "
.
" p.profileid=i.profile_id and "
.
" p.profileid=i.profile_id and "
.
" p.version=i.profile_version "
.
" p.version=i.profile_version "
.
"where i.profile_id='
$profileid
') "
.
"left join geni.geni_users as u on u.uuid=i.creator_uuid "
.
"union "
.
"where i.profile_id='
$profileid
' "
.
"(select h.uuid,h.profile_version,h.created,h.destroyed, "
.
"order by i.created desc"
);
" h.creator,p.uuid as profile_uuid "
.
$query2_result
=
DBQueryFatal
(
"select h.uuid,h.profile_version,h.created,h.destroyed, "
.
" h.creator,p.uuid as profile_uuid,u.email "
.
" from apt_instance_history as h "
.
" from apt_instance_history as h "
.
"left join apt_profile_versions as p on "
.
"left join apt_profile_versions as p on "
.
" p.profileid=h.profile_id and "
.
" p.profileid=h.profile_id and "
.
" p.version=h.profile_version "
.
" p.version=h.profile_version "
.
"where h.profile_id='
$profileid
') "
.
"left join geni.geni_users as u on u.uuid=h.creator_uuid "
.
"order by created desc"
);
"where h.profile_id='
$profileid
' "
.
"order by h.created desc"
);
if
(
mysql_num_rows
(
$query_result
)
==
0
)
{
if
(
mysql_num_rows
(
$query1_result
)
==
0
&&
mysql_num_rows
(
$query2_result
)
==
0
)
{
$message
=
"<b>Oops, there is no activity to show you.</b><br>"
;
$message
=
"<b>Oops, there is no activity to show you.</b><br>"
;
SPITUSERERROR
(
$message
);
SPITUSERERROR
(
$message
);
exit
();
exit
();
}
}
while
(
$row
=
mysql_fetch_array
(
$query_result
))
{
foreach
(
array
(
$query1_result
,
$query2_result
)
as
$query_result
)
{
while
(
$row
=
mysql_fetch_array
(
$query_result
))
{
$uuid
=
$row
[
"uuid"
];
$uuid
=
$row
[
"uuid"
];
$puuid
=
$row
[
"profile_uuid"
];
$puuid
=
$row
[
"profile_uuid"
];
$pversion
=
$row
[
"profile_version"
];
$pversion
=
$row
[
"profile_version"
];
$created
=
$row
[
"created"
];
$created
=
$row
[
"created"
];
$destroyed
=
$row
[
"destroyed"
];
$destroyed
=
$row
[
"destroyed"
];
$creator
=
$row
[
"creator"
];
$creator
=
$row
[
"creator"
];
$email
=
$row
[
"email"
];
# If a guest user, use email instead.
if
(
isset
(
$email
))
{
$creator
=
$email
;
}
$instance
=
array
();
$instance
=
array
();
$instance
[
"uuid"
]
=
$uuid
;
$instance
[
"uuid"
]
=
$uuid
;
...
@@ -97,6 +108,7 @@ while ($row = mysql_fetch_array($query_result)) {
...
@@ -97,6 +108,7 @@ while ($row = mysql_fetch_array($query_result)) {
$instance
[
"created"
]
=
$created
;
$instance
[
"created"
]
=
$created
;
$instance
[
"destroyed"
]
=
$destroyed
;
$instance
[
"destroyed"
]
=
$destroyed
;
$instances
[]
=
$instance
;
$instances
[]
=
$instance
;
}
}
}
# Place to hang the toplevel template.
# Place to hang the toplevel template.
...
...
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