Extending Login - User
Permalink
I am looking at rewriting my website and would love to start out with 5.7. I am currently using 5.5 and started my new development on 5.6. I have extended the User model so that when a user is logged on it saves a cookie to the database
/concrete/core/models/user
CheckLogin
I have copied Core/Models/User
to /Models and extended it using..
I am then using Codeigniter on the other side to grab the uID and do somethings there.
Is there an easy way to do similar in 5.7 or should I just keep going with 5.6.
/concrete/core/models/user
CheckLogin
//Next Lines are for inserting SQL $cookieID=$_COOKIE['CONCRETE5']; $userID=$this->getUserID(); $q1 = "INSERT INTO ci_cookie (id, uID) VALUES ('$cookieID', '$userID')"; $db->query($q1);
I have copied Core/Models/User
to /Models and extended it using..
I am then using Codeigniter on the other side to grab the uID and do somethings there.
Is there an easy way to do similar in 5.7 or should I just keep going with 5.6.
Thank you for the quick response .. and any additional help is appreciated. Here is what I think I understand but I don't know if I am looking in the right place or if there is just inconsistencies in what I am reading.
1. I have copied /concrete/src/cookie/cookie.php to /application/bootstratp/src/my/cookie/cookie.php
2. I have gone into /application/bootstrap/app.php and added
which I know is wrong!
3. Then in my new copied Cookie.php I have changed to
Things are broken at the app.php for sure but I am not sure about the other code either.
1. I have copied /concrete/src/cookie/cookie.php to /application/bootstratp/src/my/cookie/cookie.php
2. I have gone into /application/bootstrap/app.php and added
Core::bind('\Concrete\src\Cookie\Cookie'){ return new \Application\bootstrap\Src\My\Cookie\Cookie });
which I know is wrong!
3. Then in my new copied Cookie.php I have changed to
<?php namespace Application\bootstrap\src\My\Cookie\Cookie; use Symfony\Component\HttpFoundation\Cookie as CookieObject; use Request; class Cookie extends \Concrete\src\Cookie\Cookie { .....
Things are broken at the app.php for sure but I am not sure about the other code either.
Just by glancing at this, instead of 'src', try using 'Core'
Do I have to do anything in app.php to use the override.
After further review here is what I have but it is not working. Concrete is not using my Cookie.php
1. Copied /concrete/src/Cookie/Cookie.php to /application/bootstrap/src/my/cookie
2. In /application/bootstrap I have modified app.php to read
3. In my Cookie.php have modified to
When the cookie is created I have added my code to write the cookie to the database but it is not working.
1. Copied /concrete/src/Cookie/Cookie.php to /application/bootstrap/src/my/cookie
2. In /application/bootstrap I have modified app.php to read
Core::bind('\Concrete\Core\Cookie\Cookie',function(){ return new \Application\bootstrap\Src\My\Cookie\Cookie(); });
3. In my Cookie.php have modified to
<?php namespace Application\bootstrap\src\My\Cookie\Cookie; use Symfony\Component\HttpFoundation\Cookie as CookieObject; use Request; class Cookie extends \Concrete\Core\Cookie\Cookie { ....
When the cookie is created I have added my code to write the cookie to the database but it is not working.
Mike