Changeset 671947
- Timestamp:
- 02/22/2013 10:12:17 PM (13 years ago)
- Location:
- s2member-secure-file-browser
- Files:
-
- 79 added
- 5 edited
-
tags/0.3.6/class (added)
-
tags/0.3.6/class/index.html (added)
-
tags/0.3.6/class/psk_s2msfb.admin.class.php (added)
-
tags/0.3.6/class/psk_s2msfb.admin.manager.class.php (added)
-
tags/0.3.6/class/psk_s2msfb.admin.settings.class.php (added)
-
tags/0.3.6/class/psk_s2msfb.admin.stats.class.php (added)
-
tags/0.3.6/class/psk_s2msfb.class.php (added)
-
tags/0.3.6/class/psk_s2msfb.widgets.class.php (added)
-
tags/0.3.6/css (added)
-
tags/0.3.6/css/admin.css (added)
-
tags/0.3.6/css/bootstrap.psk.css (added)
-
tags/0.3.6/css/bootstrap.psk.min.css (added)
-
tags/0.3.6/css/index.html (added)
-
tags/0.3.6/css/jquery.tablesorter.pager.css (added)
-
tags/0.3.6/css/jqueryFileTree.css (added)
-
tags/0.3.6/css/theme.bootstrap.css (added)
-
tags/0.3.6/img (added)
-
tags/0.3.6/img/application.png (added)
-
tags/0.3.6/img/blank.png (added)
-
tags/0.3.6/img/code.png (added)
-
tags/0.3.6/img/css.png (added)
-
tags/0.3.6/img/db.png (added)
-
tags/0.3.6/img/directory.png (added)
-
tags/0.3.6/img/doc.png (added)
-
tags/0.3.6/img/file.png (added)
-
tags/0.3.6/img/film.png (added)
-
tags/0.3.6/img/flash.png (added)
-
tags/0.3.6/img/folder_open.png (added)
-
tags/0.3.6/img/glyphicons-halflings-white.png (added)
-
tags/0.3.6/img/glyphicons-halflings.png (added)
-
tags/0.3.6/img/html.png (added)
-
tags/0.3.6/img/index.html (added)
-
tags/0.3.6/img/java.png (added)
-
tags/0.3.6/img/linux.png (added)
-
tags/0.3.6/img/music.png (added)
-
tags/0.3.6/img/pdf.png (added)
-
tags/0.3.6/img/php.png (added)
-
tags/0.3.6/img/picture.png (added)
-
tags/0.3.6/img/ppt.png (added)
-
tags/0.3.6/img/psd.png (added)
-
tags/0.3.6/img/ruby.png (added)
-
tags/0.3.6/img/script.png (added)
-
tags/0.3.6/img/spinner.gif (added)
-
tags/0.3.6/img/txt.png (added)
-
tags/0.3.6/img/vsa.png (added)
-
tags/0.3.6/img/xls.png (added)
-
tags/0.3.6/img/zip.png (added)
-
tags/0.3.6/inc (added)
-
tags/0.3.6/inc/define.php (added)
-
tags/0.3.6/inc/index.html (added)
-
tags/0.3.6/inc/tools.class.php (added)
-
tags/0.3.6/index.html (added)
-
tags/0.3.6/js (added)
-
tags/0.3.6/js/admin.js (added)
-
tags/0.3.6/js/admin.manager.js (added)
-
tags/0.3.6/js/admin.settings.js (added)
-
tags/0.3.6/js/admin.stats.js (added)
-
tags/0.3.6/js/bootstrap.psk.js (added)
-
tags/0.3.6/js/bootstrap.psk.min.js (added)
-
tags/0.3.6/js/index.html (added)
-
tags/0.3.6/js/jquery-1.8.3.min.js (added)
-
tags/0.3.6/js/jquery.tablesorter.min.js (added)
-
tags/0.3.6/js/jquery.tablesorter.pager.js (added)
-
tags/0.3.6/js/jquery.tablesorter.widgets.min.js (added)
-
tags/0.3.6/js/jqueryFileTree.js (added)
-
tags/0.3.6/languages (added)
-
tags/0.3.6/languages/index.html (added)
-
tags/0.3.6/languages/psk_s2msfb-fr_FR.mo (added)
-
tags/0.3.6/languages/psk_s2msfb-fr_FR.po (added)
-
tags/0.3.6/languages/psk_s2msfb.mo (added)
-
tags/0.3.6/languages/psk_s2msfb.po (added)
-
tags/0.3.6/lic (added)
-
tags/0.3.6/lic/index.html (added)
-
tags/0.3.6/lic/licence.txt (added)
-
tags/0.3.6/readme.txt (added)
-
tags/0.3.6/s2member-secure-file-browser.php (added)
-
tags/0.3.6/uninstall.php (added)
-
trunk/class/psk_s2msfb.admin.stats.class.php (modified) (11 diffs)
-
trunk/class/psk_s2msfb.widgets.class.php (modified) (2 diffs)
-
trunk/css/jqueryFileTree.css (modified) (1 diff)
-
trunk/img/vsa.png (added)
-
trunk/inc/tools.class.php (modified) (1 diff)
-
trunk/lic/index.html (added)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
s2member-secure-file-browser/trunk/class/psk_s2msfb.admin.stats.class.php
r669185 r671947 79 79 80 80 global $wpdb; 81 81 82 $tablename = $wpdb->prefix . PSK_S2MSFB_DB_DOWNLOAD_TABLE_NAME; 82 $sql = "SELECT userid,useremail,ip,UNIX_TIMESTAMP(created),filepath FROM $tablename ORDER BY created DESC"; 83 $result = $wpdb->get_results( $sql , ARRAY_A ); 84 85 foreach (get_users() as $user) 86 $users[$user->ID] = $user->display_name; 87 88 89 if (count($result)==0) { 83 $where = ( isset( $_GET['t'] ) ) ? 'WHERE created > NOW() - INTERVAL ' . (int) $_GET['t'] . ' DAY' : ''; 84 85 $sql = "SELECT COUNT(DISTINCT userid) FROM $tablename $where"; 86 $duser = $wpdb->get_row( $sql , ARRAY_N ); 87 $duser = $duser[0]; 88 89 $sql = "SELECT COUNT(DISTINCT filepath) FROM $tablename $where"; 90 $dfile = $wpdb->get_row( $sql , ARRAY_N ); 91 $dfile = $dfile[0]; 92 93 $sql = "SELECT userid,useremail,ip,UNIX_TIMESTAMP(created),filepath FROM $tablename $where ORDER BY created DESC"; 94 $result = $wpdb->get_results( $sql , ARRAY_A ); 95 $cresul = count($result); 96 97 $link = '?page=' . $_GET['page']; 98 99 if ( $cresul == 0 ) { 90 100 echo '<div class="alert alert-error">' . __("No download",S2MSFB_ID) . '</div>'; 91 101 } 92 else { 102 103 echo '<div class="btn-group">'; 104 echo ' <button class="btn btn-primary btn-mini dropdown-toggle" data-toggle="dropdown">' . __( 'Display' , 'PSK_S2MSFB_ID' ).' <span class="caret"></span></button>'; 105 echo ' <ul class="dropdown-menu">'; 106 echo ' <li><a href="' . $link . '">' . __('all records',PSK_S2MSFB_ID) . '</a></li>'; 107 echo ' <li class="divider"></li>'; 108 echo ' <li><a href="' . $link . '&t=1">' . __('one day',PSK_S2MSFB_ID) . '</a></li>'; 109 echo ' <li><a href="' . $link . '&t=7">' . __('one week',PSK_S2MSFB_ID) . '</a></li>'; 110 echo ' <li><a href="' . $link . '&t=31">' . __('one month',PSK_S2MSFB_ID) . '</a></li>'; 111 echo ' <li><a href="' . $link . '&t=365">' . __('one year',PSK_S2MSFB_ID) . '</a></li>'; 112 echo ' </ul>'; 113 echo '</div>'; 114 115 if ( $cresul > 0 ) { 116 117 foreach (get_users() as $user) 118 $users[$user->ID] = $user->display_name; 119 120 echo ' '; 121 switch (@$_GET['t']) { 122 case '1': 123 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for 24 hours' , PSK_S2MSFB_ID ) , $dfile, $cresul, $duser); 124 break; 125 case '7': 126 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one week' , PSK_S2MSFB_ID ) , $dfile, $cresul, $duser); 127 break; 128 case '31': 129 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one month' , PSK_S2MSFB_ID ) , $dfile, $cresul, $duser); 130 break; 131 case '365': 132 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one year' , PSK_S2MSFB_ID ) , $dfile, $cresul, $duser); 133 break; 134 default: 135 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s)' , PSK_S2MSFB_ID ) , $dfile, $cresul, $duser); 136 break; 137 } 138 echo '<br/>'; 139 93 140 echo '<table class="table sort table-bordered table-hover table-condensed">'; 94 141 echo '<thead><tr>'; … … 124 171 echo '</tfoot>'; 125 172 echo '<tbody>'; 173 126 174 foreach($result as $row) { 175 127 176 $time = (int)$row['UNIX_TIMESTAMP(created)']; 128 177 $time+= get_option('gmt_offset') * 3600; … … 144 193 echo '</tr>'; 145 194 } 195 146 196 echo '</tbody>'; 147 197 echo '</table>'; … … 165 215 $tablename = $wpdb->prefix . PSK_S2MSFB_DB_DOWNLOAD_TABLE_NAME; 166 216 $where = ( isset( $_GET['t'] ) ) ? 'WHERE created > NOW() - INTERVAL ' . (int) $_GET['t'] . ' DAY' : ''; 217 218 $sql = "SELECT COUNT(DISTINCT userid) FROM $tablename $where"; 219 $duser = $wpdb->get_row( $sql , ARRAY_N ); 220 $duser = $duser[0]; 221 222 $sql = "SELECT COUNT(DISTINCT filepath) FROM $tablename $where"; 223 $dfile = $wpdb->get_row( $sql , ARRAY_N ); 224 $dfile = $dfile[0]; 225 226 $sql = "SELECT COUNT(*) FROM $tablename $where"; 227 $cresult = $wpdb->get_row( $sql , ARRAY_N ); 228 $cresult = $cresult[0]; 229 167 230 $sql = "SELECT filepath, COUNT(*) A FROM $tablename $where GROUP BY filepath ORDER BY A DESC"; 168 231 $result = $wpdb->get_results( $sql , ARRAY_A ); 232 169 233 $total = 0; 170 234 $link = '?page=' . $_GET['page']; 171 235 172 if ( count($result)==0) {236 if ( count($result) == 0 ) { 173 237 echo '<div class="alert alert-error">' . __("No download",S2MSFB_ID) . '</div>'; 174 238 } … … 187 251 188 252 if (count($result)>0) { 253 254 echo ' '; 255 switch ($_GET['t']) { 256 case '1': 257 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for 24 hours' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 258 break; 259 case '7': 260 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one week' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 261 break; 262 case '31': 263 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one month' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 264 break; 265 case '365': 266 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one year' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 267 break; 268 default: 269 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s)' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 270 break; 271 } 272 echo '<br/>'; 273 189 274 echo '<table class="table sortn table-bordered table-hover table-condensed">'; 190 275 echo '<thead><tr>'; … … 193 278 echo '</tr></thead>'; 194 279 echo '<tbody>'; 280 195 281 foreach($result as $row) { 196 282 echo '<tr>'; … … 200 286 $total += (int)$row['A']; 201 287 } 288 202 289 echo '</tbody>'; 203 290 echo '<tfoot>'; … … 242 329 global $wpdb; 243 330 244 foreach (get_users() as $user)245 $users[$user->ID] = $user->display_name;246 247 331 $tablename = $wpdb->prefix . PSK_S2MSFB_DB_DOWNLOAD_TABLE_NAME; 248 332 $where = ( isset( $_GET['t'] ) ) ? 'WHERE created > NOW() - INTERVAL ' . (int) $_GET['t'] . ' DAY' : ''; 333 334 $sql = "SELECT COUNT(DISTINCT userid) FROM $tablename $where"; 335 $duser = $wpdb->get_row( $sql , ARRAY_N ); 336 $duser = $duser[0]; 337 338 $sql = "SELECT COUNT(DISTINCT filepath) FROM $tablename $where"; 339 $dfile = $wpdb->get_row( $sql , ARRAY_N ); 340 $dfile = $dfile[0]; 341 342 $sql = "SELECT COUNT(*) FROM $tablename $where"; 343 $cresult = $wpdb->get_row( $sql , ARRAY_N ); 344 $cresult = $cresult[0]; 345 249 346 $sql = "SELECT userid, COUNT(*) A FROM $tablename $where GROUP BY userid ORDER BY A DESC"; 250 347 $result = $wpdb->get_results( $sql , ARRAY_A ); 348 251 349 $total = 0; 252 350 $link = '?page=' . $_GET['page']; … … 269 367 270 368 if (count($result)>0) { 369 370 foreach (get_users() as $user) 371 $users[$user->ID] = $user->display_name; 372 373 echo ' '; 374 switch ($_GET['t']) { 375 case '1': 376 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for 24 hours' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 377 break; 378 case '7': 379 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one week' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 380 break; 381 case '31': 382 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one month' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 383 break; 384 case '365': 385 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s) for one year' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 386 break; 387 default: 388 echo sprintf( __( '%1$s distinct file(s) downloaded %2$s time(s) by %3$s distinct user(s)' , PSK_S2MSFB_ID ) , $dfile, $cresult, $duser); 389 break; 390 } 391 echo '<br/>'; 392 271 393 echo '<table class="table sortn table-bordered table-hover table-condensed">'; 272 394 echo '<thead><tr>'; … … 275 397 echo '</tr></thead>'; 276 398 echo '<tbody>'; 399 277 400 foreach($result as $row) { 278 401 if (isset($users[$row['userid']])) { … … 289 412 $total += (int)$row['A']; 290 413 } 291 292 414 293 415 echo '</tbody>'; -
s2member-secure-file-browser/trunk/class/psk_s2msfb.widgets.class.php
r669185 r671947 442 442 $r.= ( $display_icon == 'u' ) ? '<img style="float:left;width:32px;height:32px;margin-right:5px;margin-top:5px;border:1px solid #888;" src="' . PSK_Tools::get_avatar_url($user_id,32) . '" />' : ''; 443 443 $r.= ( $display_icon == 'f' ) ? '<img style="float:left;width:16px;height:16px;margin-right:5px;margin-top:2px;border:0;" src="' . PSK_S2MSFB_IMG_URL . PSK_Tools::get_file_icon($file_path) . '" />' : ''; 444 $r.= '<span style=" word-wrap:break-word;font-weight:bold;">';444 $r.= '<span style="font-size:11px;word-wrap:break-word;font-weight:bold;">'; 445 445 $r.= $file . '</span>'; 446 446 $r.= ($show_filepath) ? '<br/><small>' . sprintf( __( 'in %s' , PSK_S2MSFB_ID ) , $path ) . '</small>' : ''; … … 622 622 $r.= '<li style="padding-top:4px;">'; 623 623 $r.= ( $display_icon == 'f' ) ? '<img style="float:left;width:16px;height:16px;margin-right:5px;margin-top:2px;border:0;" src="' . PSK_S2MSFB_IMG_URL . PSK_Tools::get_file_icon($file_path) . '" />' : ''; 624 $r.= '<span style=" word-wrap:break-word;font-weight:bold;">';624 $r.= '<span style="font-size:11px;word-wrap:break-word;font-weight:bold;">'; 625 625 $r.= $file . '</span>'; 626 626 $r.= ($show_filepath) ? '<br/><small>' . sprintf( __( 'in %s' , PSK_S2MSFB_ID ) , $path ) . '</small>' : ''; -
s2member-secure-file-browser/trunk/css/jqueryFileTree.css
r653734 r671947 125 125 .jqueryFileTree LI.ext_tar A.link { background: url(../img/zip.png) left top no-repeat; } 126 126 .jqueryFileTree LI.ext_gz A.link { background: url(../img/zip.png) left top no-repeat; } 127 .jqueryFileTree LI.ext_vsa A.link { background: url(../img/vsa.png) left top no-repeat; } 127 128 -
s2member-secure-file-browser/trunk/inc/tools.class.php
r669185 r671947 109 109 'tar' => 'zip.png', 110 110 'gz' => 'zip.png', 111 'vsa' => 'vsa.png', 111 112 ); 112 113 -
s2member-secure-file-browser/trunk/readme.txt
r669202 r671947 5 5 Requires at least: 3.3 6 6 Tested up to: 3.5.1 7 Stable tag: 0.3. 57 Stable tag: 0.3.6 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 135 135 Yes ! `And access-s2member-ccap*` too ! 136 136 137 = The browser does not work, it displays `Invalid nonce` for registered users. = 138 139 The authentication on your website is broken because of a plugin (AJAX requests not correctly handled). 140 This behaviour is correct and it is protecting your files ! 141 It happens for example when your authentication is only performed in a HTTPS form and the navigation is done in HTTP. 142 If you use the `Wordpress HTTP` plugin from http://mvied.com/projects/wordpress-https/ for example, you have to force HTTPS on each page which includes the s2member Secure File browser. 143 137 144 138 145 == What's next? == … … 161 168 162 169 == Changelog == 170 171 = 0.3.6 = 172 * Enhancement : Add admin statistics (total downloads, unique files and unique downloaders) 173 * Enhancement : Add FAQ "Invalid Nonce" 174 * Enhancement : Add vsa file extension 163 175 164 176 = 0.3.5 =
Note: See TracChangeset
for help on using the changeset viewer.