11
sceilig
Re: Unable to access Admin menu in Administraion Section
  • 2006/10/29 5:24

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


I ALWAYS get this error when I try to access admin.php without being logged in.
Im using XOOPS 2.2.4 and the default theme.

I traced the error to originate from this file
themes/default/js/adminmenu.js (line 24)
<code>
this.init = function() { if (!document.getElementById(this.id)) alert("Element '"+ this.id +"' does not exist in this document. AdMenu cannot be initialized."); if (this.type != "horizontal" && this.type != "vertical") { return alert("AdMenu.init() failed. Unknown menu type: '"+this.type+"'");}
</code>

When I commented out this line, I didnt get the javascript alert window, however I do see a yellow javascript error icon in the bottom left corner of the IE browser - when clicked on it says "'AdMenu' is undefined".

This error prevents the automatic redirection on this page. The redirection message is "You don't have the right to access this area".

Anyone know of a easy hack to bypass getting this javascript alert popup in the first place?



12
sceilig
Re: Some probleme with svn.sourceforge.net
  • 2006/10/3 5:46

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


I too would like if someone could shed a bit of light on how best to implement fpdf or an equivalent pdf class in any XOOPS module.

I would like to be able to put a pdf icon in most of my modules so someone could print out that exact page - be it a single news article or a list of calendar entries.

I have smartsection installed and that comes with fpdf included. I would like to be able to make a generic installation of fpdf - perhaps put it in the "Frameworks" folder, although I also havent seen any doucmentation on the usage of stuf fin the Frameworks folder.

The link to the svn folder above shows the fpdf application but I would imagine there is a complete "download" for it and how to implement it for XOOPS modules?



13
sceilig
Re: Uploading and resizing images
  • 2006/8/4 15:39

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


I did actually create a hack to handle image resizing - i added a function called XoopsMakeThumbnail() to the class/uploader.php file

A rough implementation of it would be this:
include_once XOOPS_ROOT_PATH "/class/uploader.php";
$allowed_mimetypes = array('image/gif''image/jpeg''image/pjpeg''image/x-png');
$uploader = new XoopsMediaUploader($persdir$allowed_mimetypes$maxfilesize$maxfilewidth$maxfileheight);
if (
$uploader->fetchMedia('foto')) {
   if (!
$uploader->XoopsMakeThumbnail()) {
       
$output_str .= $uploader->getErrors();
   } else {      
       
$foto $uploader->savedFileName;
   }   
} else {
   
$output_str .= $uploader->getErrors();
}


My function calculates how much to resize the image so that it is reduced to either the maxwidth or maxheight. Then since I use imagemagick, I resize the image that way.

However, i never published the hack and wouldnt until it was streamlined with having more parameters (choosing GD, netpbm or imagemagick and their paths). And whoever was to use would need to know their way around xoops.

Alternatively, you could use the imanager or ibrowser plugins with a html editor module like TinyEditor - you can upload a photo and specify a number of different resizes to be made from it.



14
sceilig
Re: How to allow a cron job to access a xoops module?
  • 2006/6/27 10:43

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


I did manage to answer my own question. In case anyone else might be looking to perform the same task, this can be done using cURL.

First you use curl to post login credentials to XOOPS and then you can access the module function that requires administrator access.

e.g.
$url "http://www.domainname.com/user.php";
$login_data 
    
"op=login"
    
."&uname=admin"
    
."&pass=password";
$user_agent "php" phpversion();

$ch curl_init($url);    // initialize curl handle
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_VERBOSE1);
curl_setopt($chCURLOPT_USERAGENT$user_agent);
curl_setopt($chCURLOPT_COOKIEJAR"curl_cookies");
curl_setopt($chCURLOPT_COOKIEFILE"curl_cookies"); // file where the cookies will be stored
curl_setopt($chCURLOPT_POSTFIELDS$login_data); 
$result curl_exec($ch); // run the whole process

// you should now be logged in 

// now access the admin only page
$url2 "http://www.domainname.com/modules/modulename/admin/index.php?op=process_admin_function";
curl_setopt($chCURLOPT_URL$url2);
$result curl_exec($ch);
echo 
$result// $result contains the page contents which you can parse for the success or error message you are looking for

//close cURL connection
curl_close($ch);



15
sceilig
Looking to have a couple of modules commissioned
  • 2006/6/22 17:59

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


I need to hire a programmer to have a couple of modules created and wondered if anyone has suggestions of a place I could post these projects - somewhere tht has XOOPS developers on board. Or if there are XOOPS developers on here that would be interested in creating these modules.

thanks!



16
sceilig
Re: How to allow a cron job to access a xoops module?
  • 2006/6/22 2:05

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


Accessing the php script in a cron job is fine - its just authentication I think i would have the problem with.
e.g.
a cron job to access
http://www.domainname.com/modules/modname/admin/index.php?op=runcron

would just redirect to the XOOPS login page - just as what would happen to a guest user visiting that page since it is only allowed access by XOOPS administrators.



17
sceilig
How to allow a cron job to access a xoops module?
  • 2006/6/22 0:41

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


I want to setup a cron job to execute a script within a XOOPS module on a daily basis - and that module is set up to only have administration access. Is this possible? How do I go about authenticating the cron job so that XOOPS allows it to execute the script?



18
sceilig
Re: Multisite HACK for 2.2.3 Final
  • 2006/6/18 18:30

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


Hmm....I would probably spend ages trying to get it working for 2.2.4 and with much hairpulling and frustration.

I would be willing to pay for someone to get the multisite hack working for my system and with what my needs are for managing many subsites from a single source code with either 1 or many databases.

Either that or to contract out a project where someone builds a multisite module for my needs at whatever the going programming rate is for creating such a module/hack.

Anyone interested or know of a good place where I could post this project to XOOPS freelancers?



19
sceilig
Re: Multisite HACK for 2.2.3 Final
  • 2006/6/18 9:02

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


Deepy or anyone else,
I realize this thread is for the Multisite Hack for 2.2.3 but what changes would need to be made to get it to work for 2.2.4. I think you mentioned that for instance the includes/common.php file would have changes but I couldnt really see the changes between the common.php for the Hack and the one for 2.2.4?

I would dearly love to be able to get the hack working for 2.2.4 so I can start to experiment with just how far I can go with the hack i.e. managing hundreds of sites from a single source code, handling the domain parking correctly and tweaking the table sharing to meet my needs.

If I knew what the steps were in how the hack/xoops interprets a site/subsite and serves up the relevant content, I could probably delve into the code myself and find out where my problem is.



20
sceilig
Problem with xoopsmailer return-path
  • 2006/6/16 6:19

  • sceilig

  • Just popping in

  • Posts: 53

  • Since: 2006/3/1 1


Perhaps a phpmailer or OOP expert out there could help me on this one.

Im trying to access the "From" email address from within the mail_send() function for mail being sent using the phpmailer class. But my OOP skills are limited as to how I can get access to it ($this->Sender) - or another variable that holds that email address.
/class/mail/phpmailer/class.phpmailer.php (line 618)

Here's my longwinded reason for why I need access to it.

In sending mail via the xoopsmailer class, I noticed that the return-path in the email header isnt the "From" email address - but defaults to being whatever the server's return-path setting is. Even though return-path is specified in the xoopsmailer send() function, it doesnt get used, on any server Ive used anyway.
i.e.
$this->headers[] = "Return-Path: ".$this->fromEmail;

Instead, you have to "force" the return-path. In the normal php mail() function it would be like this
mail ($to, $subject, $body, $headers, "-f".$fromEmail);

However the class.phpmailer.php file (which xoopsmailer extends) does have the ability to set a -f parameter in the mail_send() function on around line 635. But it can only do this if a From Email Address is available to that function.

I dont think it is in Xoops???

if the $this->Sender field exists, a force return-path parameter will be enforced (conditional on line 14 below). I have confirmed that this doesnt happen and $this-Sender is empty. I could get the sender's email address by parsing the $headers variable but surely there is an easier way of getting at the variable???

function mail_send($header$body) {
       
        
// Cannot add Bcc's to the $to
        
$to $this->to[0][0]; // no extra comma
        
for($i 1$i count($this->to); $i++)
            
$to .= sprintf(",%s"$this->to[$i][0]);

        if (
$this->Sender != "" && PHP_VERSION >= "4.0")
        {
            
$old_from ini_get("sendmail_from");
            
ini_set("sendmail_from"$this->Sender);
        }

        if (
$this->Sender != "" && PHP_VERSION >= "4.0.5")
        {
            
// The fifth parameter to mail is only available in PHP >= 4.0.5
            
$params sprintf("-oi -f %s"$this->Sender);
            
$rt = @mail($to$this->encode_header($this->Subject), $body$header$params);
        }
        else
        {
            
$rt = @mail($to$this->encode_header($this->Subject), $body$header);
        }




TopTop
« 1 (2) 3 4 5 »



Login

Who's Online

246 user(s) are online (148 user(s) are browsing Support Forums)


Members: 0


Guests: 246


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits