• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.0 Editing Templates and Defining a Callback for Pages

Kier

XenForo Developer
Staff member
#44
Yes, in your callback code:
PHP:
$t = $controller->_input->filterSingle('t', XenForo_Input::STRING);

$s = $controller->_input->filterSingle('s', XenForo_Input::UINT);
 

ijeffers

Active member
#45
I feel thick (no change there then!)

I've enabled debug mode, get prompted for a username and password, but it's always rejected as incorrect.

I've tried creating new users, reseting passwords and nothing seems to kick in - any ideas?
 

Kier

XenForo Developer
Staff member
#46
I feel thick (no change there then!)

I've enabled debug mode, get prompted for a username and password, but it's always rejected as incorrect.

I've tried creating new users, reseting passwords and nothing seems to kick in - any ideas?
I can think of a couple of things:

1) Are you sure you're getting a no permission login error, or is it failing to connect for another reason? Try connecting with your web browser to {xenforo}/admindav.php/ first.

2) Is admindav.php on a site protected by .htaccess password protection? They both use HTTP Basic Auth, and can not co-exist.
 

dmnkhhn

Active member
#47
I am using Transmit to map the WebDAV connection to a virtual drive. That allows me to open all files with Textmate as if they were on my local drive.
It's working fine but the saving takes up to 10 seconds. If I happen to reload the page while the template is saving, the layout is broken and sometimes the content of the template gets lost.

I don't know if it's Textmate, Transmit or XenForo - does anyone else have this slow saving problem?
 

pjfry

Active member
#48
I can think of a couple of things:

1) Are you sure you're getting a no permission login error, or is it failing to connect for another reason? Try connecting with your web browser to {xenforo}/admindav.php/ first.

2) Is admindav.php on a site protected by .htaccess password protection? They both use HTTP Basic Auth, and can not co-exist.
Hi there I have similar problems with connecting to my XenForo. My Dreamweaver says wrong password or username. I have checked the URL manually (http://www.onlinegilde.net/admindav.php/). The URL worked fine and the login form pop up. When I type there my username and password and press enter it only shows up this dialog again.

Dreamweaver always says Wrong username and password. But I am absolutly sure that I have typed in the correct username and password.

Any suggestions how to solve this problem?

Thanks a lot!
 

ijeffers

Active member
#49
I can think of a couple of things:

1) Are you sure you're getting a no permission login error, or is it failing to connect for another reason? Try connecting with your web browser to {xenforo}/admindav.php/ first.

2) Is admindav.php on a site protected by .htaccess password protection? They both use HTTP Basic Auth, and can not co-exist.
Like pjfry, Dreamweaver is returning the error Wrong Username and Password and using my browser (both IE and Firefox) just keep returning the login box.

The admindav.php doesn't have any other .htaccess above it apart from the default xenforo one.
 

skhms

Active member
#50
I'm having similar problems like ijeffers and pjfry.
Took a look at the script and did some googling but I'm not sure if I understand things correctly.

But I read on a couple of places that HTTP Basic authentication with PHP can't be used if you're running PHP as a CGI?
If that's true, that you must run PHP as a server module, then that is probably my problem.

Unfortunately I didn't figure out how to change that on my local server installation last night so I haven't tested this as much as I would want to.

/SK
 

ijeffers

Active member
#52
Think pjfry has hit the nail on the head, it's cgi mode that's causing the problem.

Tried to create a .htaccess rule based of SabreDav but it didn't make any difference:

Code:
RewriteRule .* /admindav.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
SabreDav says you should use this, but not sure if Server.php is the admindav or the Server.php hidden away in the library:

If you use PHP through CGI or FastCGI and Apache authentication headers are not passed through by default. You can enable this with the following mod_rewrite rule:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>
If you already had a mod_rewrite rule to map all urls to a server file, you might need to change this to something like:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* /server.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>
Note the /server.php. Make sure this reflects the correct location of your server file
Bunged my admin details into the array in admindav.php and it connected straight away (but obviously not a very clever idea!!!!)

Don't know if there's another way to pass the auth information to admindav.php or if there's another file which needs the auth details passing too or whether my modified rule is just cack!

Any ideas Kier?

I can think of a couple of things:

1) Are you sure you're getting a no permission login error, or is it failing to connect for another reason? Try connecting with your web browser to {xenforo}/admindav.php/ first.

2) Is admindav.php on a site protected by .htaccess password protection? They both use HTTP Basic Auth, and can not co-exist.
Hi there I have similar problems with connecting to my XenForo. My Dreamweaver says wrong password or username. I have checked the URL manually (http://www.onlinegilde.net/admindav.php/). The URL worked fine and the login form pop up. When I type there my username and password and press enter it only shows up this dialog again.

Dreamweaver always says Wrong username and password. But I am absolutly sure that I have typed in the correct username and password.

Any suggestions how to solve this problem?

Thanks a lot!
Like pjfry, Dreamweaver is returning the error Wrong Username and Password and using my browser (both IE and Firefox) just keep returning the login box.

The admindav.php doesn't have any other .htaccess above it apart from the default xenforo one.
 

Shadab

Well-known member
#53
Don't know if there's another way to pass the auth information to admindav.php or if there's another file which needs the auth details passing too or whether my modified rule is just cack!
I'm facing the same problem running Zend Server CE. (PHP as CGI/FastCGI)
This additional rule seems to fix it...
Code:
RewriteEngine On
RewriteRule ^admindav.php - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},NC,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data|js|styles|install) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
 

ijeffers

Active member
#54
I'm facing the same problem running Zend Server CE. (PHP as CGI/FastCGI)
This additional rule seems to fix it...
Code:
RewriteEngine On
RewriteRule ^admindav.php - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},NC,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data|js|styles|install) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
That sorted it, cheers Shadab! Right rule, wrong place (stupid SaberDav instructions!!)
 

skhms

Active member
#55
I'm facing the same problem running Zend Server CE. (PHP as CGI/FastCGI)
This additional rule seems to fix it...
Code:
RewriteEngine On
RewriteRule ^admindav.php - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},NC,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data|js|styles|install) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Yep, that did it for me too. Thanks!

/SK
 

pjfry

Active member
#57
Hi there sorry for the late reply. After a lot of testing I can say, yes this problem is because of CGI / Fast CGI. So I have tested this Code on my site:

Code:
RewriteRule ^admindav.php - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},NC,L]
But it didn't worked. Then I tested another hoster, there the some Code worked. So I am not sure why one time the code work und sometimes not. So I contaced my first hoster and told him the problem. Now he is testing. As soon I get an answer from my hoster I will post it here. So maybe someone has the some problem.

Greetings

Benny
 

brendanc

Active member
#59
Anyone know how to connect webdav up on a htaccess protected domain? Seems to be struggling to connect and I didnt really want to remove htaccess auth before we're ready :(
I don't believe that's actually possible, as both htaccess and WebDAV use HTTP Basic Auth.
If your client supports it you can probably do
Code:
user:pass@host
for the host. That will satisfy htaccess credentials. I've done this before using simple PHP/curl.

I'm not entirely certain if this will work in your case, but it's worth a shot?