[ZendTo] Re: Some little bugs & suggestions

Jules Jules at ZendTo.com
Mon Aug 9 11:16:38 BST 2010



On 09/08/2010 10:52, Sergio Rabellino wrote:
> Dear jules,
>  i've found these ??bugs??:
>
> lib/NSSDropoff.php: line 1343  $smarty->assign('fileCount',   
> $readFileCount);
> readFileCount does not exists anywhere: it's a duplicate of 
> realFilecount ??? line to be removed
Fixed.
>
> lib/NSSDropoff.php: line 1343  while ( $i < $fileCount ) {
> I believe it's correct use $i strictly < of $fileCount; this potential 
> error is repeated along the code in 1193/1251
No, because the $i starts at 1 and not 0.
>
> www/Verify.php: line 55   if ($resp->is_valid && ( $theVerify = new 
> Verify($theDropbox) )) {
> The logical AND is && and must be used when almost one of the ops is 
> not an integer.
Fixed.
>
> www/Verify.php: line 122  $theDropbox->writeToLog("Public 
> key=".$reCaptchaPublicKey);
> useless log line: who care of it ?
Agreed :-)
>
> And two suggestion: the site policy could be more clear if present in 
> every page.
> I've added in NSSDropoff below line 744 these 3
>>      $smarty->assign('maxBytesForFile', 
>> NSSFormattedMemSize($this->_maxBytesForFile));
>>      $smarty->assign('maxBytesForDropoff', 
>> NSSFormattedMemSize($this->_maxBytesForDropoff));
>>      $smarty->assign('retainDays', $this->_retainDays);
Added.
>
> and added into header.tpl below line 53 as follow:
>> <tr>
>> <td id="prefs" align=right colspan=2>
>> <BR>MAX single attachment size: {$maxBytesForFile} &nbsp; &nbsp; &nbsp;
>> <BR>MAX total  attachment size: {$maxBytesForDropoff} &nbsp; &nbsp; 
>> &nbsp;
>> <BR>Attachment Retain time: {$retainDays} &nbsp; &nbsp; &nbsp;
>> </td>
>> </tr>
> So in every page is printed-out the site policy (max bytes .. and 
> retain time).
Disagree with you there. But the tpl files are all marked as config 
files and so won't be overwritten by upgrades (if using the RPM). The 
whole idea is that you can easily customise the appearance of the 
website *completely* which is why I extracted the UI from the 
application code in the first place. So please do feel free to make 
changes to the website. I'll happily put in the application code 
necessary for your website alterations to work, that's no problem.
>
> Another change is into the single dropoff view, where is printed-out 
> the creation date, but i believe it's more important to know when the 
> dropoff will expire.
> So I changed the NSSDropoff.php adding below line 790:
>   global $prefs;
>
> and below line 852:
>
>   $smarty->assign('expiration',strftime("%d %b 
> %Y&nbsp;&nbsp;%r",timeForDate($this->created())+3600*24*$prefs['numberOfDaysToRetain']));
I have added this instead:
$smarty->assign('expiryDate', 
timeForDate($this->created()+3600*24*$prefs['numberOfDaysToRetain']));
You put user interface code (i.e. the strftime() call) into your 
application code. Naughty!
>
>
> and changed into the show_dropoff.tpl, lines from 72-75 to
>> <tr>
>> <td class="UD_form_lined" align="right"><b>Will Expire On:</b></td>
>> <td><tt>{$expiration}</tt></td>
Put this instead:
{$expiryDate|date_format:"%d %b %Y&nbsp;&nbsp;%r"}

I think other people may disagree with you about the expiry date being 
more important than the createdDate. I would want to know that "they 
were the files he sent me last Friday". So my comments about you 
customising the website to your needs, as above, still stand.

So that site customisers know the variable exists, I have added a row 
containing it to the template but commented out the HTML.

Thanks for your fixes and comments!

Jules.
>> </tr>
>
> Bye.
> -- 
> Ing. Sergio Rabellino
>
> Università degli Studi di Torino
> Dipartimento di Informatica
> ICT Services Director
> Tel +39-0116706701  Fax +39-011751603
> C.so Svizzera , 185 - 10149 - Torino
>
> <http://www.di.unito.it>
>
>
> _______________________________________________
> ZendTo mailing list
> ZendTo at zendto.com
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto
>    

Jules

-- 
Julian Field MEng CITP CEng
www.ZendTo.com

Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Follow me at twitter.com/JulesFM

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20100809/a79da9ba/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 4570 bytes
Desc: not available
Url : http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20100809/a79da9ba/attachment.jpe 


More information about the ZendTo mailing list