Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Change the user list to a sortable table. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | user-config-revamp |
Files: | files | file ages | folders |
SHA1: |
72de3100c29070aaf2c237a0d1ddaf2f |
User & Date: | drh 2015-11-17 19:51:13 |
Context
2015-11-17
| ||
19:52 | Revamp the user list setup page. Show the last change time and expiration date for each login. Make the user list sortable using javascript. ... (check-in: 01b13199 user: drh tags: trunk) | |
19:51 | Change the user list to a sortable table. ... (Closed-Leaf check-in: 72de3100 user: drh tags: user-config-revamp) | |
17:12 | Improved display of the user list on the setup menu. ... (check-in: d3fbf717 user: drh tags: user-config-revamp) | |
Changes
Changes to src/setup.c.
︙ | ︙ | |||
143 144 145 146 147 148 149 | ** ** Show a list of users. Clicking on any user jumps to the edit ** screen for that user. Requires Admin privileges. */ void setup_ulist(void){ Stmt s; int prevLevel = 0; | < < < < < < < < < < < < < < < < < < < < | > > | | < < | < < | > > | | | | > > < < < < | > > > | > > > > | | | < > | < < < | < < | < > | < < < < < | < < | > > | < | > | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | ** ** Show a list of users. Clicking on any user jumps to the edit ** screen for that user. Requires Admin privileges. */ void setup_ulist(void){ Stmt s; int prevLevel = 0; login_check_credentials(); if( !g.perm.Admin ){ login_needed(0); return; } style_submenu_element("Add", "Add User", "setup_uedit"); style_submenu_element("Help", "Help", "setup_ulist_notes"); style_header("User List"); @ <table border=1 cellpadding=2 cellspacing=0 class='userTable'> @ <thead><tr><th>UID <th>Category <th>Capabilities <th>Info <th>Last Change</tr></thead> @ <tbody> db_prepare(&s, "SELECT uid, login, cap, date(mtime,'unixepoch')" " FROM user" " WHERE login IN ('anonymous','nobody','developer','reader')" " ORDER BY login" ); while( db_step(&s)==SQLITE_ROW ){ int uid = db_column_int(&s, 0); const char *zLogin = db_column_text(&s, 1); const char *zCap = db_column_text(&s, 2); const char *zDate = db_column_text(&s, 4); @ <tr> @ <td><a href='setup_uedit?id=%d(uid)'>%d(uid)</a> @ <td><a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> @ <td>%h(zCap) if( fossil_strcmp(zLogin,"anonymous")==0 ){ @ <td>All logged-in users }else if( fossil_strcmp(zLogin,"developer")==0 ){ @ <td>Users with '<b>v</b>' capability }else if( fossil_strcmp(zLogin,"nobody")==0 ){ @ <td>All users without login }else if( fossil_strcmp(zLogin,"reader")==0 ){ @ <td>Users with '<b>u</b>' capability }else{ @ <td> } if( zDate && zDate[0] ){ @ <td>%h(zDate) }else{ @ <td> } @ </tr> } db_finalize(&s); @ </tbody></table> @ <div class='section'>Users</div> @ <table border=1 cellpadding=2 cellspacing=0 class='userTable' id='userlist'> @ <thead><tr> @ <th>ID<th>Login<th>Caps<th>Info<th>Chng<th>Expire</tr></thead> @ <tbody> db_prepare(&s, "SELECT uid, login, cap, info, date(mtime,'unixepoch'), lower(login) AS sortkey, " " CASE WHEN info LIKE '%%expires 20%%'" " THEN substr(info,instr(lower(info),'expires')+8,10)" " END AS exp" " FROM user" " WHERE login NOT IN ('anonymous','nobody','developer','reader')" " ORDER BY sortkey" ); while( db_step(&s)==SQLITE_ROW ){ int uid = db_column_int(&s, 0); const char *zLogin = db_column_text(&s, 1); const char *zCap = db_column_text(&s, 2); const char *zInfo = db_column_text(&s, 3); const char *zDate = db_column_text(&s, 4); const char *zSortKey = db_column_text(&s,5); const char *zExp = db_column_text(&s,6); @ <tr> @ <td><a href='setup_uedit?id=%d(uid)'>%d(uid)</a> @ <td data-sortkey='%h(zSortKey)'><a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a> @ <td>%h(zCap) @ <td>%h(zInfo) @ <td>%h(zDate?zDate:"") @ <td>%h(zExp?zExp:"") @ </tr> } @ </tbody></table> db_finalize(&s); output_table_sorting_javascript("userlist","nktxTT",2); style_footer(); } /* ** WEBPAGE: setup_ulist_notes ** ** A documentation page showing notes about user configuration. This information |
︙ | ︙ |