Welcome Guest, Not a member yet? Register   Sign In
  simpler way to find request method
Posted by: El Forum - 12-19-2007, 07:26 AM - Replies (9)

[eluser]zauber[/eluser]
Quick question: is there a CI-built-in method to do: if($_SERVER["REQUEST_METHOD")=="POST"){...}

Not that it's very hard to do, I just couldn't find anything about request-method handling in the docs, and figured there might be something.


  image_lib crop method with GD
Posted by: El Forum - 12-19-2007, 06:03 AM - Replies (4)

[eluser]kenjis[/eluser]
Sample code in User Guide:

Code:
$config['image_library'] = 'imagemagick';
$config['library_path'] = '/usr/X11R6/bin/';
$config['source_image'] = '/path/to/image/mypic.jpg';
$config['x_axis'] = '100';
$config['y_axis'] = '60';

$this->image_lib->initialize($config);

if ( ! $this->image_lib->crop())
{
    echo $this->image_lib->display_errors();
}

Above code doesn't work with GD.
Because of below code, function image_process_gd in image_lib.php.
If there is no $config['width'] nor $config['height'], then,
$this->width = $this->orig_width and $this->height = $this->orig_height.

Code:
// If the target width/height match the source then it's pointless to crop, right?
            if ($this->width >= $this->orig_width AND $this->height >= $this->orig_height)
            {
                // We'll return true so the user thinks the process succeeded.
                // It'll be our little secret...
    
                return TRUE;
            }

Only crop method with GD needs $config['width'] and $config['height'].
Is this a bug? or spec?


  Session starts only at the second login
Posted by: El Forum - 12-19-2007, 05:29 AM - Replies (3)

[eluser]Takapaka[/eluser]
Hi guys,
My problem is with a session that starts only at second attempt of login. Both in IE and Firefox. I tried to search for similar post but could not find it. Anybody had similar problem?

I can ask the guys who are rebuilding my page right now to look for a fix, but they will rip me off again Sad

I am not a programmer myself but at least I think that this is the piece of code that starts the session in my page:

Code:
function trylogin($email, $password, $session = true)
{
    
    log_message('debug', " +trylogin()");
    
    if($email != '' && $password != '')
    {

        // Only continue if user and pass are supplied
        // SHA1 the password if it isn't already
        if(strlen($password) != 40){ $password = sha1($password); }
        
        
        $sql = "SELECT userid FROM emails ".
             "WHERE email ='$email'";
        $query = $this->object->db->query($sql);
        $query = $query->row();
        
        $userid =     $query->userid;
        
            // Check details in DB
        $sql = "SELECT name, surname FROM users ".
             "WHERE userid = $userid ".
             " AND password='$password' LIMIT 1";
        $query = $this->object->db->query($sql);
        // If user/pass is OK then should return 1 row containing username,fullname
        $return = $query->num_rows();

        
        log_message('debug', "++trylogin userid= ".$userid);
        log_message('debug', "++trylogin return= ".$return);
        log_message('debug', "++trylogin email= ".$email);
        log_message('debug', "++trylogin password= ".$password);
        if($return == 1)
        {

          $row = $query->row();
                
          $username = $row->name . ' ' . $row->surname;
          // Set session data array
          $sessdata = array(
                   'userid'   => $userid,              // TODO   fix it
                    'username' =>     $row->name,
                    'loggedin' => TRUE,
                    'fullname' => $username

          );
          if($session == true)
          {
                    // Set the session
                    $this->object->session->set_userdata($sessdata);
                    return TRUE;

          }
          else
          {// param to set the session = false:
            // return the data only without setting session
                    return $sessdata;
          }
        }
        else
        {        // no rows with matching user & pass - ACCESS DENIED!!
                return FALSE;
        }

   }
   else
   {
            // missing username or password
            return FALSE;
    }
}


  CI - security
Posted by: El Forum - 12-19-2007, 04:50 AM - No Replies

[eluser]zauber[/eluser]
I think that a discussion about web-application-security in the context of codeigniter (and perhaps other frameworks for comparison) is necessary. I'm thinking about everything from secure configuration and setup to the security features built in to codeigniter to the implementation of libraries for furhter security enhancements. See this thread as a starting point: http://ellislab.com/forums/viewthread/67250/P10/#331831


  Why HTMLPurifier does not work in inktype
Posted by: El Forum - 12-19-2007, 02:02 AM - Replies (8)

[eluser]Déjà Vu[/eluser]
I am trying to add, HTMLPurifier to blog controller from inktype

Code:
if ($this->validation->run()) {

            $this->mdl_comments->urltitle = $this->urltitle;
            $this->mdl_comments->author = $this->input->post('author');
            $this->mdl_comments->emailaddress = $this->input->post('emailaddress');
            $this->mdl_comments->url = $this->input->post('url');

            $this->load->library('HTMLPurifier');
            $purifier_config = HTMLPurifier_Config::createDefault();
            $this->htmlpurifier->purify($comment, $purifier_config);
            
            $this->mdl_comments->comment = $this->input->post('comment');
            $this->mdl_comments->save();

        }

But every time the page loads HTMLPurifier library, the page does not show anything, and I cannot add simple text to the comments form

How can I add HTMLPurifier support to the blog controller in inktype?

Thanks in advance


  it is possible a anchor with image?
Posted by: El Forum - 12-19-2007, 01:56 AM - Replies (7)

[eluser]Isern Palaus[/eluser]
Hello,

I'm newbie in Code Igniter as a programmer and i usually use anchor() function to create the links. Now I've a a images that needs to be a link, how can I apply some function like anchor? If I use

Code:
<?php
anchor('home','<img src="...">');
?&gt;

I see the image with a link but adds "> next to the image.

Sorry for my school English and thanks in advance,
-- Isern Palaus


  Number/Currency Formatting
Posted by: El Forum - 12-19-2007, 12:06 AM - Replies (3)

[eluser]ccachor[/eluser]
So I'm loading the price from a database but I need it to display using the number_format function in php. I'm doing a select all and loading it into my view as $data. Where would I format the string? In the controller or the view? I'm doing a foreach in my results as well. I just don't know where to format that string. Help!


  Geo Locater
Posted by: El Forum - 12-18-2007, 11:27 PM - Replies (3)

[eluser]Antivanity[/eluser]
Made quick a IP to Geographical location lib.
http://codeigniter.com/wiki/Geo_Locater/

First time making a topic on this forum, long time user, thought I'd contribute something.

Peace to all,
Antivanity


  reloading query data on redirect
Posted by: El Forum - 12-18-2007, 11:00 PM - Replies (4)

[eluser]kseize[/eluser]
I have a hockey scoring application wherein a page lists all the goals entered by the user so far. If they want to modify or delete the goal, it launches a form in an iframe in thickbox. On submit, the iframe/thickbox is close, the database is modified and I call a redirect (url helper) back to the page that lists all the goals.

Problem is: the redirect doesn't seem to be causing the controller to return updated values. I have to hit browser refresh to see updated values. I do not have any form of caching on.

Any ideas on how to force this?

BTW, first post here, and thanks to all who help out in these forums. It's been super helpful.


  nobody 99 problem
Posted by: El Forum - 12-18-2007, 10:23 PM - Replies (6)

[eluser]nirbhab[/eluser]
hi guys!

i am facing an very old problem again generally known as 99 or nobody problem.

when we upload any file through http or file uploading script in linux server(hosting provided by other companies, server are only reachable through ftp, http and c-panel.)
file are not owened by any of the users. files are kept with 99 or nobody as a owner.

Than the general ftp user, who's logging through proper username and password is not allowed to make any change to the file.

i think you have got the senerio.
only solution which i have previously is using ftp uploading..........
for which i have to use a secure use of my ftp username and password, which i think not to use. Confusedmirk:

can i have some other solutions?

not attaching any sample code as it won't help me out. As code are doing there work as told to.

note: Don't have access to .htaccess and httpd.conf of apache.


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Error / Shield 1.0.3 + Ci...
by kenjis
54 minutes ago
Integrating Bootstrap 5 i...
by tarcisiodev1
2 hours ago
Asset Minification Packag...
by tarcisiodev1
2 hours ago
Modify users data as an a...
by luckmoshy
2 hours ago
Is it possible to go back...
by ejimenezo
7 hours ago
SQL server connection not...
by davis.lasis
Today, 07:11 AM
Validation | trim causes ...
by Gary
Today, 05:09 AM
Problem with session hand...
by Julesb
Today, 04:13 AM
External script access to...
by PomaryLinea
Today, 03:58 AM
VIRUS reported after Chro...
by InsiteFX
Yesterday, 11:34 PM

Forum Statistics
» Members: 85,496
» Latest member: fcb8ist
» Forum threads: 77,586
» Forum posts: 376,025

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB