rejetto forum
May 25, 2012, 09:29:46 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: build 272 what is wrong or missing  (Read 1559 times)
0 Members and 1 Guest are viewing this topic.
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« on: December 18, 2010, 02:21:53 PM »

Already indicated
Quote
 procedure handleItem(f:Tfile);  //main.pas
  var
    type_, s, url, fingerprint, itemFolder: string;
    nonPerc: TStringDynArray;
  begin
  //We have to make an exception with virtual links
  if not f.isLink and ansiContainsStr(f.resource, '?') then exit; // unicode filename?

  if f.size > 0 then inc(totalBytes, f.size);

New: The rerouting login is wrong  when the destination does not exist,It was necessary to me to erase cookies concerning HFS under firefox to obtain the web page because hfs jammed because of it.

Quote
   function getAccountRedirect():string;   //main.pas
    var
      acc: Paccount;
    begin
    result:='';
    acc:=accountRecursion(data.account, ARSC_REDIR);
    if acc = NIL then exit;
    result:=acc.redir;
    if (result = '')  or ansiContainsStr(result, '://') then exit;
    // if it's not a complete url, it may require some fixing
    if not ansiStartsStr('/', result) then result:='/'+result;
    result:=xtpl(result,['\','/']);
//add by mars 18/12/2010
   if fileExistsByURL(result) then exit;
    add2log('Error on redirect with account '+acc.user+crlf+'The path is invalid :'+ result);
    result:='';

    end; // getAccountRedirect

this can help the admin to detect bad redirect path under accounts dialogbox
Quote
procedure ToptionsFrm.loadAccountProperties(); //optionsdlg.pas
....
redirBox.Text:=a.redir;
notesBox.text:=a.notes;
//add by mars 18/12/20010
redirBox.color:=clWindow;
if (a.redir>'') and not fileExistsByURL(a.redir) then redirBox.color:=clRed;


groupsBtn.enabled:=FALSE;
for i:=0 to length(tempAccounts)-1 do
  if tempAccounts.group and (i <> accountsBox.itemIndex) then
    groupsBtn.enabled:=TRUE;

updateAccessBox();
accountsBox.invalidate();
end; // loadAccountProperties


procedure ToptionsFrm.applyBtnClick(Sender: TObject);
begin
  saveValues();
// this is necessary to refresh the account box when we click on the apply button
 selectAccount(accountsBox.itemIndex);  //add by mars 18/12/2010
end;



* bad redirect path.png (2.95 KB, 333x171 - viewed 113 times.)
« Last Edit: December 18, 2010, 03:41:56 PM by Mars » Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #1 on: December 23, 2010, 08:00:39 AM »

New: The rerouting login is wrong  when the destination does not exist,It was necessary to me to erase cookies concerning HFS under firefox to obtain the web page because hfs jammed because of it.

i just tried specifying a non-existent path.
at login i just got a "not found" message, then clicked on the link to go to the root.
no jamming, no need to erase cookies.
can you please give us some details on the problem you faced, how to reproduce it?

Quote
this can help the admin to detect bad redirect path under accounts dialogbox

i like it!
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #2 on: December 24, 2010, 11:50:25 AM »

Quote
can you please give us some details on the problem you faced, how to reproduce it?
A simple example
 the root not authorized on access for the person is protected by a compulsory login,.

With the request of login, if the redirect is defective (case of nonexistent directory), we are redirected or towards the not found or towards the new identification.
 the only solution to go out of this buckle is to close the sailor browser.

It is not easy to manage to make well understand the principle, but in the long run that can be irritating as situation this 'not found', that is why I recommend the solution of the function getAccountRedirect()

Bad redirect == NO redirect

 Wink
Logged
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1046


....... chut ! shh!


View Profile WWW
« Reply #3 on: December 27, 2010, 05:28:02 PM »

Hi! Smiley

I added some elements at the code of Mars (in brown color).
If you find these changes useful ... do not forget to activate the "Hint" for the "redirBox" and "accountLinkBox". Wink

Quote

procedure ToptionsFrm.loadAccountProperties(); //optionsdlg.pas
var
  a: Paccount;
  b, bakWrap, existRedir: boolean;
  i: integer;
....
redirBox.Text:=a.redir;
existRedir:=fileExistsByURL(a.redir);
redirBox.Hint:='';
redirBox.color:=clWindow;  //add by mars 18/12/20010
redirBox.font.color:=clWindowText;
accountLinkBox.hint:='';
notesBox.text:=a.notes;

if (a.redir>'') and not existRedir then redirBox.color:=clRed;  //add by mars 18/12/20010
if (a.redir>'') and not existRedir then redirBox.font.color:=clWhite;

if (a.redir>'') and existRedir then
redirBox.Hint:='Redirect URL for "'+a.user+'":    '+#13+'  '+a.redir;

if (a.redir>'') and not existRedir then
redirBox.Hint:='INVALID redirect URL for "'+a.user+'":    '+#13+'  '+a.redir+#13'Please correct this error.';

if (accountLinkBox.text>'') then
accountLinkBox.hint:='"'+a.user+'"'+' is member of this(these) group(s):     '+#13+'      '+join(#13+'      ',a.link);


groupsBtn.enabled:=FALSE;
for i:=0 to length(tempAccounts)-1 do
  if tempAccounts.group and (i <> accountsBox.itemIndex) then
    groupsBtn.enabled:=TRUE;

updateAccessBox();
accountsBox.invalidate();
end; // loadAccountProperties


procedure ToptionsFrm.applyBtnClick(Sender: TObject);
begin
  saveValues();
// this is necessary to refresh the account box when we click on the apply button
 selectAccount(accountsBox.itemIndex);  //add by mars 18/12/2010
end;


* 1.jpg (57.68 KB, 518x354 - viewed 116 times.)

* 2.jpg (59.99 KB, 518x354 - viewed 107 times.)

* 3.jpg (59.65 KB, 518x354 - viewed 118 times.)
« Last Edit: December 29, 2010, 08:27:38 PM by SilentPliz » Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #4 on: January 05, 2011, 11:33:46 AM »

@rejetto  about this topic

At first, I thought of using the code  dyndns.host:=trim(dyndns.host);
but later wall up reflection the solution for the user is the following one:

each space is replaced by %20, So the has the choice to correct the domain as he thinks best Wink

Quote
function dynDNSinputHost():boolean;
begin
result:=FALSE;
while true do
  begin
  if not inputQuery('Enter host', 'Enter domain (full form!)', dyndns.host)
  or (dyndns.host = '') then exit;
 dyndns.host:=hslib.encodeURL(dyndns.host, False, True, False);  //add by mars
  if pos('://', dyndns.host) > 0 then
    chop('://', dyndns.host);
  if pos('.', dyndns.host) > 0 then
    begin
    result:=TRUE;
    exit;
    end;
  msgDlg('Please, enter it in the FULL form, with dots', MB_ICONERROR);
  end;
end; // dynDNSinputHost
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #5 on: January 12, 2011, 03:51:40 PM »

jquery must be moved.

 It's a Web resource in free access, but if it is necessary to use the internal resource, it can be blocked(surrounded) by a bad identification.

Quote
 runEventScript('request');
  if data.disconnectReason > '' then
    begin
    getPage('deny', data);
    exit;
    end;
  if conn.reply.mode = HRM_REDIRECT then
    exit;

 if data.urlvars.values['mode'] = 'jquery' then
    begin
    replyWithString(getRes('jquery'));
    conn.reply.contentType:='text/javascript';
    exit;
    end;


  // forbid using invalid credentials
  if not freeLoginChk.checked and not specialGrant then
    if assigned(data.account) and (data.account.pwd <> data.pwd)
    or (data.account = NIL) and (data.usr > '') and not usersInVFS.match(data.usr, data.pwd) then
      begin
      runEventScript('unauthorized');
      getPage('unauthorized', data);
      conn.reply.realm:='Invalid login';
      exit;
      end;

  if ansiStartsStr('/~img', url) then
    begin
    if not sendPic(data) then
      getPage('not found', data);
    exit;
    end;

 if data.urlvars.values['mode'] = 'jquery' then
    begin
    replyWithString(getRes('jquery'));
    conn.reply.contentType:='text/javascript';
    exit;
    end;

  f:=findFileByURL(url);
« Last Edit: January 26, 2011, 08:20:56 AM by SilentPliz » Logged
rejetto forum
« Reply #5 on: January 12, 2011, 03:51:40 PM »

Do you like this software? Consider even $2
 Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #6 on: January 25, 2011, 12:31:33 PM »

each space is replaced by %20, So the has the choice to correct the domain as he thinks best Wink

domains cannot have spaces, so it's pointless. If you really care, you should replace spaces with nothing. I used trim just because i guess it's enough for users' needs.
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #7 on: January 25, 2011, 12:43:11 PM »

jquery must be moved.
 It is a Web resource in free access, but if it is necessary to use the internal resource, she can be blocked(surrounded) by a bad identification

does this happen when a template uses jquery in error pages?
if yes i will change it.
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #8 on: January 25, 2011, 12:59:01 PM »

can a template uses jquery in error pages?

It is the possibility which is not to be neglected, thus for me it justifies the movement  Wink
Logged
rejetto
Administrator
Insane programmer
*
Offline Offline

Italy Italy

Posts: 11831


View Profile
« Reply #9 on: January 29, 2011, 12:58:34 PM »

in such case we must move also the pics
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 23, 2012, 01:32:14 AM
anything