CodeIgniter Forums
CodeExtinguisher Release Candidate 11 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: CodeExtinguisher Release Candidate 11 (/showthread.php?tid=7249)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20


CodeExtinguisher Release Candidate 11 - El Forum - 04-09-2008

[eluser]minimal design[/eluser]
sweeeeeeeeeet!!! It working Smile Thanks! Did you mention that in your screencast, I remmembered something about permissions but assumed it was just the database config file. my bad... Thanks again! I can't wait to delve into it... Made me want to learn about YAML too Smile Did I say thanks?


CodeExtinguisher Release Candidate 11 - El Forum - 04-09-2008

[eluser]Thoer[/eluser]
[quote author="andjules" date="1207799596"]are there configuration options that distinguish between add & edit (insert & update)? If not, there might be some reason to put that in the long-term roadmap...

Example: as an admin, I might want to create a user, which might involve setting their password (which I would hopefully grant them the permission to change). At a later time, as an admin, I may want to change their access level... but currently, if 'password' is part of the 'add' form, then it's also part of the 'edit' form... so I have to set a new password for them whenever I edit any other property (bad).

This can be worked around with custom forms/controllers, of course, but something to think about in the long term.[/quote]

You don't have to hack the forms or controllers to achieve it.. The password plugin is quite easily customizable. As a matter of fact, I used to a have a password plugin that works this way, although I'm not sure it's available from the trunk. I'll upload id, and expect to have a new release candidate soon.


CodeExtinguisher Release Candidate 11 - El Forum - 04-09-2008

[eluser]Thoer[/eluser]
[quote author="andjules" date="1207779155"]question about the preview (which works fine for me with preview/preview):
when I do an example > add and fill in several fields but not the 'Textbox Test', it throws a validation error (great!) BUT also clears all the fields I DID fill in (bad!). I guess I should opt for javascript validation?[/quote]

jTaby forgot to mention, but it's fixed.. Wink


CodeExtinguisher Release Candidate 11 - El Forum - 04-10-2008

[eluser]Comter[/eluser]
First off, jTaby, an amazingly useful and fast CRUD interface. I installed RC10 and then noticed this pesky little forum post that mentioned RC11, heh. So of course I had to go with that version.

At first the log directory being world write-able tripped me up but then that directory doesn't appear to exist anymore in RC11. Then I realized that I had to mess with the DB charsets (still using MySQL 4.0, I need to update). I just recently started using CI (a week ago) and I was just about to go build my own CRUD interface (although I usually call it a "TYHN", as in, "There, You Happy Now?" after a project leader has bugged me repeatedly) but then I stumbled on this one.

Couple of bugs/features that I noticed:

I was working through the screencast for RC10 and I created the deals.yml.
Code:
form_setup:
    expiry_date:
        class: Date
    description:
        class: TextArea
The tabs-to-spaces issue almost got me (it even looks like you're using tabs in the screencast) but I read through that entire RC10 thread so I noticed it and luckily my text editor (Text Wrangler) has a detab function. The issue is that when I was adding a new ManyToMany on the Cars add new page, the Expiry Date field doesn't show the javascript calendar (and I know I did the yml file right because going to the Deals add new page showed the calendar on the Expiry Date).

Also how do I get back to editing a new ManyToMany on the Cars add new page after I close the new ManyToMany? Clicking on the box that the new one left behind doesn't do anything and clicking on Add New just makes another one. You'd almost think that you could create a new ManyToMany using it's own submit button (or some AJAX) and not the Cars add new submit button.

The RC10 screencast just seems to stop after adding the second car. Is it supposed to stop there? How do I remove the Example menu item (removing the related_example table seemed to remove that but the example table is gone but the menu item remains)? I'm pretty sure I'm just missing some config option where it's hard-coded.

When editing the Dodge Dakota in the Cars example, the ManyToMany boxes appear to suggest that there are two deals called "50% off" (and I can even move them both to the left or right) but when looking at the Deals table there is only one "50% off" row. Is it supposed to look like that?

Oh, and setup details: FF3.0b5/MacOSX10.4/PHP4/MySQL4. I'm sure I'll have more questions later and thanks again for CE.

-the purring dork


CodeExtinguisher Release Candidate 11 - El Forum - 04-10-2008

[eluser]Thoer[/eluser]
@Comter: I can't answer most of your questions but the Example menu item is hardcoded in 'views/navigation.php'.


CodeExtinguisher Release Candidate 11 - El Forum - 04-10-2008

[eluser]Thoer[/eluser]
[quote author="andjules" date="1207799596"]are there configuration options that distinguish between add & edit (insert & update)? If not, there might be some reason to put that in the long-term roadmap...

Example: as an admin, I might want to create a user, which might involve setting their password (which I would hopefully grant them the permission to change). At a later time, as an admin, I may want to change their access level... but currently, if 'password' is part of the 'add' form, then it's also part of the 'edit' form... so I have to set a new password for them whenever I edit any other property (bad).

This can be worked around with custom forms/controllers, of course, but something to think about in the long term.[/quote]

Here's my new 'controllers/userregistration.php', let me know if you like it:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
include_once("codexcontroller.php");
/**
* User Registration controller
*/
class UserRegistration extends codexController
{    
    var $strong_pass = TRUE;
    
    function UserRegistration()
    {
        codexController::codexController();
        $this->load->helper('inflector');
        if ($this->config->item('access_levels')===FALSE)
            $this->config->load('access_levels', TRUE);
        $access_levels = array_flip($this->config->item('access_levels'));
        
        $rules['username'] = "trim|required";
        $rules['password'] = "trim|callback__add_required|sha1";
        $rules['access_level'] = "trim|required";
        $config = array(
                    'db_table' => 'users',
                    'form_setup' => array(
                        'username' => array('class'=>'TextBox'),
                        'password' => array('class'=>'Password'),
                        'access_level' => array(
                            'class'=>'DropDown',
                            'params' => array(
                                'list' => $access_levels,
                                ),
                            ),
                        ),
                    'rules'=>$rules,
                    'display_fields'=>array('username', 'access_level'),
                    'page_header'=>'User Management',
                    'controller_name' => 'userregistration',
                    );
        $this->setConfig($config);

    }

    function _add_required($str)
    {
        if ($str!=='' && $this->strong_pass && !preg_match('|^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,100}$|', $str))
        {
            $this->codexvalidation->set_message('_add_required', 'Password requires one lower case letter, one upper case letter, one digit, minimum 6 characters in length');
            return FALSE;
        }
        if (is_null($this->codexadmin->active_id))
        {
            $this->codexvalidation->set_message('_add_required', 'Password is required when adding a new user.');
            return ($str!=='');
        }
        return TRUE;
    }
}
?>



CodeExtinguisher Release Candidate 11 - El Forum - 04-10-2008

[eluser]andjules[/eluser]
Thanks so much Thoer!
I didn't realize you could add callbacks to the rules like that... great example.


CodeExtinguisher Release Candidate 11 - El Forum - 04-10-2008

[eluser]Comter[/eluser]
[quote author="Thoer" date="1207835444"]@Comter: I can't answer most of your questions but the Example menu item is hardcoded in 'views/navigation.php'.[/quote]

Thanks, I knew it was somewhere I just wasn't sure where.

-the purring dork


CodeExtinguisher Release Candidate 11 - El Forum - 04-10-2008

[eluser]hugslife[/eluser]
Hi! I have a question/bug report in regards to the SQL for ci_sessions. I'm a total n00b to this stuff, so go easy on me if I'm off-base, k? Smile

The SQL for ci_sessions table in documentation.html is
Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
      session_id varchar(40) DEFAULT '0' NOT NULL,
      ip_address varchar(16) DEFAULT '0' NOT NULL,
      user_agent varchar(50) NOT NULL,
      last_activity int(10) unsigned DEFAULT 0 NOT NULL,
      PRIMARY KEY (session_id)
    );

However, I noticed that codex.sql is different:
Code:
CREATE TABLE IF NOT EXISTS `ci_sessions` (
  `session_id` varchar(40) NOT NULL default '0',
  `session_start` int(10) unsigned NOT NULL default '0',
  `session_last_activity` int(10) unsigned NOT NULL default '0',
  `session_ip_address` varchar(16) NOT NULL default '0',
  `session_user_agent` varchar(50) NOT NULL,
  `session_data` text NOT NULL,
  PRIMARY KEY  (`session_id`)
);

Going by the CI user guide, I believe that the first example (w/o the "session_" prefix) is the correct SQL, although RC11 looks for the session_data field. Anyways, thought I'd mention it.

PS - Thank you so much for your work on this project, it's great!


CodeExtinguisher Release Candidate 11 - El Forum - 04-10-2008

[eluser]Majd Taby[/eluser]
actually, the documentation is outdated. CodeExtinguisher v2.0 uses OBSession which has a different db schema than the CI one.