Changeset 2496


Ignore:
Timestamp:
Sep 4, 2008, 2:57:55 AM (16 years ago)
Author:
rvelices
Message:
  • remove hello_world plugin (not working anymore)
  • web service method images.add works only for admins now
  • fix template-common js web service calls did not have the parameters url encoded
  • improve admin user_list - submitting the form with no user selected triggers a javascript alert (had fun with jquery selectors)
Location:
trunk
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/template/yoga/admin/user_list.tpl

    r2426 r2496  
    308308
    309309</form>
     310
     311<script type="text/javascript">// <![CDATA[
     312{literal}jQuery("form:last").submit( function() {
     313        if ( jQuery("input[name=target][value=selection]:checked", this).length > 0 )
     314        if ( jQuery("input[name=selection]:checked", this).length == 0)
     315        {
     316                alert( {/literal}"{'Select at least one user'|@translate|escape:javascript}"{literal} );
     317                return false;
     318        }
     319        return true;
     320}
     321);{/literal}
     322// ]]>
     323</script>
     324 
  • trunk/include/ws_functions.inc.php

    r2463 r2496  
    919919{
    920920  global $conf;
    921  
     921  if (!is_admin() || is_adviser() )
     922  {
     923    return new PwgError(401, 'Access denied');
     924  }
     925
    922926  // name
    923927  // category_id
     
    926930  // thumbnail_content
    927931  // thumbnail_sum
    928  
     932
    929933  // $fh_log = fopen('/tmp/php.log', 'w');
    930934  // fwrite($fh_log, time()."\n");
     
    935939  list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
    936940  list($year, $month, $day) = preg_split('/[^\d]/', $dbnow, 4);
    937  
     941
    938942  $upload_dir = sprintf(
    939943    PHPWG_ROOT_PATH.'upload/%s/%s/%s',
     
    943947    );
    944948
    945   fwrite($fh_log, $upload_dir."\n");
    946  
     949  //fwrite($fh_log, $upload_dir."\n");
     950
    947951  if (!is_dir($upload_dir)) {
    948952    umask(0000);
     
    955959
    956960  $filename_wo_ext = $date_string.'-'.$random_string;
    957  
     961
    958962  $file_path = $upload_dir.'/'.$filename_wo_ext.'.jpg';
    959963  $fh_file = fopen($file_path, 'w');
     
    968972    mkdir($thumbnail_dir, 0777);
    969973  }
    970  
     974
    971975  $thumbnail_path = sprintf(
    972976    '%s/%s%s.%s',
     
    10121016    array($insert)
    10131017    );
    1014  
     1018
    10151019  // fclose($fh_log);
    10161020}
  • trunk/template-common/scripts.js

    r2429 r2496  
    121121                                {
    122122                                        for (var i=0; i<parameters[property].length; i++)
    123                                                 url += "&"+property+"[]="+parameters[property][i];
     123                                                url += "&"+property+"[]="+encodeURIComponent(parameters[property][i]);
    124124                                }
    125125                                else
    126                                         url += "&"+property+"="+parameters[property];
     126                                        url += "&"+property+"="+encodeURIComponent(parameters[property]);
    127127                        }
    128128                }
     
    151151                                eval('resp = ' + transport.responseText);
    152152                        }
    153                         catch (e)
    154                         {
     153                        catch (e) {
    155154                                this.dispatchError( 200, e.message + '\n' + transport.responseText.substr(0,512) );
    156155                        }
Note: See TracChangeset for help on using the changeset viewer.