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
c1ba157f
Commit
c1ba157f
authored
Oct 31, 2017
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The search user/project tabs now searches all users in all portals
and all projects in all portals.
parent
78142b6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
www/aptui/js/lists.js
www/aptui/js/lists.js
+5
-2
www/aptui/lists.ajax
www/aptui/lists.ajax
+15
-14
www/aptui/template/lists.html
www/aptui/template/lists.html
+3
-0
No files found.
www/aptui/js/lists.js
View file @
c1ba157f
...
...
@@ -138,7 +138,9 @@ $(function ()
"
<td><a href='user-dashboard.php?user=
"
+
user
.
usr_uid
+
"
'>
"
+
user
.
usr_uid
+
"
</a></td>
"
+
"
<td>
"
+
user
.
usr_name
+
"
</td>
"
+
"
<td>
"
+
user
.
usr_affil
+
"
</td></tr>
"
;
"
<td>
"
+
user
.
usr_email
+
"
</td>
"
+
"
<td>
"
+
user
.
usr_affil
+
"
</td>
"
+
"
<td>
"
+
user
.
portal
+
"
</td></tr>
"
;
}
$
(
'
#search_users_table tbody
'
).
html
(
html
);
$
(
'
#search_users_table
'
).
trigger
(
"
update
"
,
[
false
]);
...
...
@@ -168,7 +170,8 @@ $(function ()
project
.
pid
+
"
</a></td>
"
+
"
<td><a href='user-dashboard.php?user=
"
+
project
.
usr_uid
+
"
'>
"
+
project
.
usr_name
+
"
</a></td>
"
+
"
<td>
"
+
project
.
usr_affil
+
"
</td></tr>
"
;
"
<td>
"
+
project
.
usr_affil
+
"
</td>
"
+
"
<td>
"
+
project
.
portal
+
"
</td></tr>
"
;
}
$
(
'
#search_projects_table tbody
'
).
html
(
html
);
$
(
'
#search_projects_table
'
).
trigger
(
"
update
"
,
[
false
]);
...
...
www/aptui/lists.ajax
View file @
c1ba157f
<?php
#
# Copyright (c) 2000-201
6
University of Utah and the Flux Group.
# Copyright (c) 2000-201
7
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -65,16 +65,12 @@ function Do_SearchUsers()
SPITAJAX_ERROR
(
-
1
,
"Illegal text to search for"
);
return
-
1
;
}
$portal_test
=
"portal='
$PORTAL_GENESIS
'"
;
if
(
$ISEMULAB
)
{
$portal_test
=
"(portal is null or
$portal_test
)"
;
}
$safe_text
=
addslashes
(
"%${text}%"
);
$query_result
=
DBQueryFatal
(
"select uid,usr_name,usr_affil,
portal from users
"
.
"
where
$portal_test
and
"
.
"
(uid like '
$safe_text
' or "
.
DBQueryFatal
(
"select uid,usr_name,usr_affil,
usr_email,portal
"
.
"
from users
"
.
"
where
(uid like '
$safe_text
' or "
.
" usr_affil like '
$safe_text
' or "
.
" LCASE(usr_email) like '
$safe_text
' or "
.
" usr_name like '
$safe_text
') "
.
...
...
@@ -83,9 +79,14 @@ function Do_SearchUsers()
while
(
$row
=
mysql_fetch_array
(
$query_result
))
{
$blob
=
array
();
if
(
!
isset
(
$row
[
"portal"
]))
{
$row
[
"portal"
]
=
"Classic"
;
}
$blob
[
"usr_uid"
]
=
$row
[
"uid"
];
$blob
[
"usr_name"
]
=
$row
[
"usr_name"
];
$blob
[
"usr_affil"
]
=
$row
[
"usr_affil"
];
$blob
[
"usr_email"
]
=
$row
[
"usr_email"
];
$blob
[
"portal"
]
=
$row
[
"portal"
];
$results
[]
=
$blob
;
}
SPITAJAX_RESPONSE
(
$results
);
...
...
@@ -110,17 +111,12 @@ function Do_SearchProjects()
SPITAJAX_ERROR
(
-
1
,
"Illegal text to search for"
);
return
-
1
;
}
$portal_test
=
"p.portal='
$PORTAL_GENESIS
'"
;
if
(
$ISEMULAB
)
{
$portal_test
=
"(p.portal is null or
$portal_test
)"
;
}
$safe_text
=
addslashes
(
"%${text}%"
);
$query_result
=
DBQueryFatal
(
"select pid,u.uid,u.usr_name,u.usr_affil,p.portal "
.
" from projects as p "
.
"left join users as u on u.uid_idx=p.head_idx "
.
"where
$portal_test
and "
.
" (pid like '
$safe_text
' or "
.
"where (pid like '
$safe_text
' or "
.
" p.name like '
$safe_text
' or "
.
" p.why like '
$safe_text
' or "
.
" u.usr_name like '
$safe_text
' or "
.
...
...
@@ -130,10 +126,15 @@ function Do_SearchProjects()
while
(
$row
=
mysql_fetch_array
(
$query_result
))
{
$blob
=
array
();
if
(
!
isset
(
$row
[
"portal"
]))
{
$row
[
"portal"
]
=
"Classic"
;
}
$blob
=
array
();
$blob
[
"pid"
]
=
$row
[
"pid"
];
$blob
[
"usr_uid"
]
=
$row
[
"uid"
];
$blob
[
"usr_name"
]
=
$row
[
"usr_name"
];
$blob
[
"usr_affil"
]
=
$row
[
"usr_affil"
];
$blob
[
"portal"
]
=
$row
[
"portal"
];
$results
[]
=
$blob
;
}
SPITAJAX_RESPONSE
(
$results
);
...
...
www/aptui/template/lists.html
View file @
c1ba157f
...
...
@@ -120,7 +120,9 @@
<tr>
<th>
UID
</th>
<th>
Name
</th>
<th>
Email
</th>
<th>
Affiliation
</th>
<th>
Portal
</th>
</tr>
</thead>
<tbody>
...
...
@@ -145,6 +147,7 @@
<th>
PID
</th>
<th>
Leader
</th>
<th>
Affiliation
</th>
<th>
Portal
</th>
</tr>
</thead>
<tbody>
...
...
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