Part of the EllisLab Network
   
4 of 4
4
CodeExtinguisher v2.0 Release Candidate 13
Posted: 16 May 2008 01:20 PM   [ Ignore ]   [ # 31 ]  
Grad Student
Rank
Total Posts:  43
Joined  10-05-2006

i changed lines #104, #105 and #106 of codexlogin.php from

$username=mysql_real_escape_string($username);
$password=mysql_real_escape_string($password);
$sql = "SELECT id,username,access_level FROM ".$this->users_table." WHERE username='$username' AND password='$password'";

to

$username=$this->CI->db->escape($username);
$password=$this->CI->db->escape($password);
$sql = "SELECT id,username,access_level FROM {$this->users_table} WHERE username=$username AND password=$password";

and i solved the problem (i’m tied to sqlserver).

Profile
 
 
Posted: 16 May 2008 03:30 PM   [ Ignore ]   [ # 32 ]  
Grad Student
Rank
Total Posts:  43
Joined  10-05-2006
gusa - 13 May 2008 01:53 PM

hi!
congrats for the new framework. next month i’m starting an administration tool and i hope (and taking all these progress in account, i’m sure) that codex is going to help.
let me tell u about my situation. i’m not starting from the scratch. in fact, i’m programming in ci since -let me remember- 2006 (i’m programming a foreign commerce query system; checkout http://www.mercosur.int/sim/es/siaec/view_register/search_by_code for instance). and yeah, off course, i’m not the guy who chooses which database to use (we use sql server 2000) nor which app server (iis; arghhh).
besides, we have developed some admin stuff, using freakoutlight as auth system. in fact, we have modified fal because we don’t like database sessions. we like php native sessions (via http://codeigniter.com/wiki/Native_session/).

the first thing i found is that codex uses ob session, so my first question is whether it is possible to extend codexsession without touching the code.

OMG IT WORKED!

i found a way to make codex works with native_session + sql server.

steps:

0) create the user table and insert the admin user mannualy:

CREATE TABLE [dbo].[users] (
    
[id] [int] NOT NULL ,
    
[username] [varchar] (40) COLLATE Traditional_Spanish_CI_AS NOT NULL ,
    
[password] [varchar] (40) COLLATE Traditional_Spanish_CI_AS NOT NULL ,
    
[access_level] [int] NOT NULL
) ON [PRIMARY]
GO

1) overwrite codexsession:

class codexsession extends Native_Session {

    public
function __construct()
    
{
        parent
::Native_Session();
    
}
    
    
function sess_destroy()
    
{
        $this
->destroy();
    
}
    
    
function userdata($item, $read_once = FALSE)
    
{
        $userdata
= parent::userdata($item);
        if (
$read_once === TRUE && $userdata !== FALSE) {
            $this
->unset_userdata($item);
        
}
        
return $userdata;
    
}

    
function set_flashdata($newdata = array(), $newval = '')
    
{
        
if (is_string($newdata))
        
{
            $newdata
= array($newdata => $newval);
        
}
        
        
if (count($newdata) > 0)
        
{
            
foreach ($newdata as $key => $val)
            
{
                parent
::set_flashdata($key, $val);
            
}
        }
    }
}

Note: I had to modify backend.php because APPPATH points to ‘codex/application/’ and i need it to point to an absolute path.

3) change check method of codexlogin.php:

$username=$this->CI->db->escape($username);
$password=$this->CI->db->escape($password);
$sql = "SELECT id,username,access_level FROM {$this->users_table} WHERE username=$username AND password=$password";

4) change isLoggedIn method of codexlogin.php:

$sql = "SELECT {$this->users_table}.access_level FROM {$this->users_table} WHERE  {$this->users_table}.id='$user_id'";

TADAAAAAM!! funciona!!!

now i can access to one of my tables. i’m getting errors when i try to edit any row, but the first step is done.

TODO LIST:

* filter the list of tables in the main-nav (see the attached image).
* if the main-nav spans into multiple lines, the search-plus display box breakes down.

Image Attachments
search.jpg
Click thumbnail to see full-size image
Profile
 
 
Posted: 16 May 2008 05:35 PM   [ Ignore ]   [ # 33 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  674
Joined  06-07-2007

gusa, glad you got it working smile

the new design i possted on page 3 addressed the two issues you are facing

 Signature 

CodeExtinguisher
Download: codex2_rc14.2.zip - 219 KiloBytes of Gloriousness!
Demo: Public preview - login with preview:preview
Temporary Docs: PBWiki

Profile
 
 
Posted: 16 May 2008 11:57 PM   [ Ignore ]   [ # 34 ]  
Summer Student
Total Posts:  7
Joined  05-16-2008

when can I get the new design? I like it.

Profile
 
 
Posted: 17 May 2008 12:59 PM   [ Ignore ]   [ # 35 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  674
Joined  06-07-2007

i’m working on it right now smile

 Signature 

CodeExtinguisher
Download: codex2_rc14.2.zip - 219 KiloBytes of Gloriousness!
Demo: Public preview - login with preview:preview
Temporary Docs: PBWiki

Profile
 
 
Posted: 18 May 2008 10:40 PM   [ Ignore ]   [ # 36 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  674
Joined  06-07-2007

hey guys, I just wanted to notify everyone subscribed to this thread that RC14 has just been released!

 Signature 

CodeExtinguisher
Download: codex2_rc14.2.zip - 219 KiloBytes of Gloriousness!
Demo: Public preview - login with preview:preview
Temporary Docs: PBWiki

Profile
 
 
Posted: 19 May 2008 01:12 AM   [ Ignore ]   [ # 37 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  330
Joined  05-29-2006

ok

 Signature 

CI Js_calendar plugin click

WYSIWYG with CI

Profile
 
 
Posted: 06 September 2008 02:55 AM   [ Ignore ]   [ # 38 ]  
Grad Student
Rank
Total Posts:  45
Joined  04-01-2008

Hi,
Please clear me step by step tutorial.
I am waiting

 Signature 

—————
BD-CodeIgniter-Programmer

Profile
 
 
   
4 of 4
4
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 64454 Total Logged-in Users: 19
Total Topics: 80961 Total Anonymous Users: 0
Total Replies: 435697 Total Guests: 193
Total Posts: 516658    
Members ( View Memberlist )