Welcome Guest, Not a member yet? Register   Sign In
  Integrating Bootstrap 5 into a CodeIgniter 4 Application
Posted by: tarcisiodev1 - 3 hours ago - No Replies

What is the best way to integrate Bootstrap 5 into a version controlled Ci 4 Application? How can I integrate Sass and Bootstrap to compile new classes and variables in the best way?


  Modify users data as an admin
Posted by: padam - 7 hours ago - Replies (1)

I have installed Shield in my project. As an admin in the backoffice I would like to be able to modify user data if necessary. Can anyone give me an example of how this can be done? I used to write the Validation Rules in the model for every table, but for users there are two tables


  Asset Minification Packages for CodeIgniter
Posted by: tarcisiodev1 - 7 hours ago - Replies (2)

What is the most recommended asset minification package for use in CodeIgniter projects? I'm looking for a reliable and easy-to-use solution to minify my CSS and JS files.


  Error / Shield 1.0.3 + Ci 4.5.1
Posted by: kcs - Today, 07:34 AM - Replies (1)

Hi everyone,

I followed the documentation proceeding to the installation running the composer command and the php spark setup. I can see the expected files and routes have been added to my application, but when I access /register or /login, I get this error:

Code:
Call to undefined function CodeIgniter\Shield\Authentication\Authenticators\setting()
VENDORPATH/codeigniter4/shield/src/Authentication/Authenticators/Session.php at line 685

Am I missing something? or running into a bug?

@kenjis I know you are working actively on this, thanks Smile I don't want to immediately raise an issue if that's not one, but rather a dumb thing on my end, but let me know if I should


Question Validation | trim causes 500: Internal Server Error
Posted by: Gary - Today, 05:09 AM - No Replies

Having recently upgraded from v4.4.4 to v4.5.1, I'm finding that the trim "rule" in Validation is behaving differently.

The particular problem I've experienced is, under certain conditions (when Validation is used on POST data), it is now throwing the following 500 error when the particular parameter isn't - for any number of reasons, including malicious - in the POST data... and appears to now being considered null (vs ''):


Code:
 type    "TypeError"
 code    500
 message    "trim(): Argument #1 ($string) must be of type string, null given"
 file    ".../system/Validation/Validation.php"
 
 
Having had a brief scratch around in the system files... this new behaviour is likely fallout from strict_types=1 being liberally scatted throughout the v4.5.1 code.  Although a I'd agree that (generally) a null is likely a better description of a variable that hasn't been declared, if it's a given/known requirement that this "information" has to be passed as a string from a $request (it appears that most of the Validation is/has been based on strings types, likely for this same reason), then an empty string ('') makes better sense... however, I digress.

Given that strict_types=1 now, looking at the system code, it would appear that the trim function is done automatically/implicit and applied to all data being passed to Validation, which appears to check for and handle null as an argument (though I'm not sure this is applicable to ALL rules and/or arguments being passed to Validation and am therefore reluctant to simply remove every "trim" from all my encyclopedia of rules).

Another reason I suspect that trim is done implicitly is that I don't see "trim" listed under the Available Rules in the documentation any more (if it ever was?).  To be fair, I don't recall where I initially picked up the "trim" rule from, but it's been in my rules since CI was still a .rc, and has never given any problems (and maybe it's been a waste of time, if it was already happening implicitly?).

I'm setting the particular rules as follows (in .../Config/Validation.php):


Code:
 public $rule = [
         'range' => [
             'label' => 'Validation.search.range.label',
             'rules' => 'trim|max_length[...',
             'errors' => [
                 'max_length' => 'Vali...
 
 
Given that it's particularly easy for users to tamper with the POST data... or remove arguments or default empty (but not null) variables... is it now necessary to check every argument for existence PRIOR to invoking Validation?... or can one simply remove the trim "rule" and hope for the best?


  Is it possible to go back to the previous version with composer?
Posted by: ejimenezo - Yesterday, 01:44 PM - Replies (4)

Hello everyone.
I've made an update with composer to the 4.5 version of codeigniter but my server does not allow me to install php8 for security reasons.
Is it possible to go back to a previous version?
Unfortunately I don't have a backup =(


  Problem with session handling
Posted by: Julesb - Yesterday, 09:56 AM - Replies (2)

Hi
I've just upgraded to version 4.4.8
I have a session service of my own which I am using, however this now seems to clash with the codeigniter session service.
I get the following
ErrorException

ini_set(): A session is active. You cannot change the session module's ini settings at this time
SYSTEMPATH/Session/Handlers/FileHandler.php at line 72

Code:
65
66    public function __construct(SessionConfig $config, string $ipAddress)
67    {
68        parent::__construct($config, $ipAddress);
69
70        if (! empty($this->savePath)) {
71            $this->savePath = rtrim($this->savePath, '/\\');
72            ini_set('session.save_path', $this->savePath);
73        } else {
74            $sessionPath = rtrim(ini_get('session.save_path'), '/\\');
75
76            if ($sessionPath === '') {
77                $sessionPath = WRITEPATH . 'session';
78            }
79
I am not using the Codeigniter session service, it appears to being initialized by the method storePreviousURL in Codeigniter.php, the condition is purely


Code:
        if (isset($_SESSION)) {
            session()->set('_ci_previous_url', URI::createURIString(
                $uri->getScheme(),
                $uri->getAuthority(),
                $uri->getPath(),
                $uri->getQuery(),
                $uri->getFragment()
            ));
        }
Does anyone know of a way of fixing this easily?

Jules


Exclamation CVE-2022-40834 SQL Injection Vulnerability
Posted by: reactionstudio - Yesterday, 02:47 AM - Replies (1)

Hello, I am wondering if the following CVE ever got patched: CVE-2022-40834. It says v3.1.13 is affected which seems to be the current version?
https://www.cvedetails.com/cve/CVE-2022-40835/
https://web.archive.org/web/202210071601.../README.md
There are also a number of other CVE's for v3.1.13
https://www.cvedetails.com/vulnerability...niter.html
Is CI3 still receiving security updates or are all these CVE's still exploitable?


  Codeigniter Shield Banning users?
Posted by: xsPurX - 04-24-2024, 07:43 AM - Replies (5)

Hi,
i am looking at this userguide https://shield.codeigniter.com/user_mana...ing_users/
it doesn't make sense cause where do you put the user_id to know which user to ban? The function doesn't show any user id. so if I run this function how will it know what user to ban?
Thanks,
Shawn`


  SQL server connection not working
Posted by: falagar2k - 04-24-2024, 02:31 AM - Replies (15)

Trying to connect my CodeIgniter 4.5.1 project to a SQL Server (14.0) database. Running on Windows with XAMPP, PHP version 8.2.

I downloaded the appropriate DLLs from Microsoft, put them in my PHP extensions folder and enabled the extensions

In my .env file I entered the database information:

PHP Code:
database.default.hostname "MYSERVER\TEST"
database.default.database 'mydb'
database.default.username 'myuser'
database.default.password 'mypassword'
database.default.DBDriver 'sqlsrv' 

I get the following error:

Code:
Unable to connect to the database.
Main connection [sqlsrv]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Der Wartevorgang wurde abgebrochen.
SQLSTATE: 08001, code: 258

The server is running and the credentials are correct (I triple-checked).

If I connect to the DB the "hard" way (using the same credentials), it works just fine (just dropped code below into my controller):

PHP Code:
        $serverName "MYSERVER\TEST"
        $uid "myuser";  
        $pwd 
"mypassword";  
        $databaseName 
"mydb"
        
        $connectionInfo 
= array( "UID"=>$uid,
                                "PWD"=>$pwd,
                                "Database"=>$databaseName); 
        
        $conn 
sqlsrv_connect$serverName$connectionInfo);  
        
        $tsql 
"SELECT id, name FROM users";

        $stmt sqlsrv_query$conn$tsql);  
        
if ( $stmt )  
        
{  
            
echo "Statement executed.<br>\n";  
        
}  
        else  
        
{  
            
echo "Error in statement execution.\n";  
            
die( print_rsqlsrv_errors(), true));  
        
}  
              
        
while( $row sqlsrv_fetch_array$stmtSQLSRV_FETCH_NUMERIC))  
        
{  
            
echo "Col1: ".$row[0]."\n";  
            
echo "Col2: ".$row[1]."\n";
            echo "-----------------<br>\n";  
        
}  
        
        sqlsrv_free_stmt
$stmt);  
        sqlsrv_close
$conn);  

I am probably just doing something incredibly stupid, but I have been staring at this for hours and I am at my wit's end. Anyone have an idea? Thank you for reading.


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
2 hours ago
Integrating Bootstrap 5 i...
by tarcisiodev1
3 hours ago
Asset Minification Packag...
by tarcisiodev1
4 hours ago
Modify users data as an a...
by luckmoshy
4 hours ago
Is it possible to go back...
by ejimenezo
9 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,497
» Latest member: okkubetcom
» Forum threads: 77,586
» Forum posts: 376,025

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB