SlideShare a Scribd company logo
1 of 23
Codeigniter Framework
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
5. Email & User agent & Security
Agenda
• Email.
• User agent.
• Security.
• Conclusion.
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Email
• Email class.
• Sending Email.
• Email class functions.
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Email class
• supports the following features.
- Multiple Protocols: Mail, Sendmail, and
SMTP.
- Multiple recipients.
- HTML or Plaintext email.
- Attachments
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Sending Email
$this->load->library('email');
$this->email->from('your@example.com',
'Your Name');
$this->email->to('to@example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email
class.');
$this->email->send();
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Email class functions
• from() Sets the email address and name
of the person sending the email.
• to() Sets the email address(s) of the
recipient(s).
• subject() Sets the email subject.
• message() Sets the email message body.
• send() The Email sending function.
Returns boolean TRUE or FALSE.
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Let’s Try It
Live!
User agent
• User agent class.
• Class functions.
• Example.
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
User agent class
• provides functions that help identify
information about the browser, mobile
device, or robot visiting your site.
• Agent class is must initialize in your
controller using as following:
$this->load->library('user_agent');
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Class functions
• $this->agent->is_browser()
• $this->agent->is_mobile()
• $this->agent->is_robot()
• $this->agent->browser()
• $this->agent->mobile()
• $this->agent->robot()
• $this->agent->platform()
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Example
$this->load->library('user_agent');
if ($this->agent->is_browser()){
$agent = $this->agent->browser();
}elseif ($this->agent->is_robot()){
$agent = $this->agent->robot();
}
echo $agent;
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Let’s Try It
Live!
Security
• URI Security
• Error reporting
• XSS Filtering
• Data escape
• Data validation
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
URI Security
• minimize the possibility that malicious data
can be passed to your application.
• URIs may only contain the following:
Alpha-numeric text
Tilde: ~ Period: .
Colon: : Underscore: _
Dash: -
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Error reporting
• it is typically desirable to disable PHP's
error reporting by setting the internal
error_reporting flag to a value of 0.
• This disables native PHP errors from
being rendered as output, which may
potentially contain sensitive information.
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
XSS Filtering
• CodeIgniter comes with a Cross Site
Scripting Hack prevention filter which can
either run automatically to filter all POST
and COOKIE data that is encountered, or
you can run it on a per item basis
• Loading security helper
$this->load->helper('security');
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
XSS Filtering
• xss_clean():
Provides Cross Site Script Hack filtering.
to run automatically every time it
encounters POST or COOKIE data you
can enable it by set this in config file
$config['global_xss_filtering'] = TRUE;
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
XSS Filtering
• sanitize_filename():
Provides protection against directory
traversal.
• Enable csrf protection:
by setting this in config file
$config['csrf_protection'] = TRUE;
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Data escape
• Escape data before inserting it into
database.
• $this->db->escape()
This function determines the data type so
that it can escape only string data.
• $this->db->escape_like_str()
This method should be used when strings are to
be used in LIKE conditions
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Data validation
• Validating, Filtering, and Prepping data
• We saw this in session 2 : )
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Let’s Try It
Live!
Conclusion
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
THANK YOU
Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
Questions?

More Related Content

What's hot

Php basic for vit university
Php basic for vit universityPhp basic for vit university
Php basic for vit universityMandakini Kumari
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Ayes Chinmay
 
Laravel admin20170819
Laravel admin20170819Laravel admin20170819
Laravel admin20170819yehlu
 
Mongo - an intermediate introduction
Mongo - an intermediate introductionMongo - an intermediate introduction
Mongo - an intermediate introductionnklmish
 
Black Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data RetrievalBlack Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data Retrievalqqlan
 
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Comsysto Reply GmbH
 

What's hot (8)

Php basic for vit university
Php basic for vit universityPhp basic for vit university
Php basic for vit university
 
JSP : Creating Custom Tag
JSP : Creating Custom Tag JSP : Creating Custom Tag
JSP : Creating Custom Tag
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
 
Laravel admin20170819
Laravel admin20170819Laravel admin20170819
Laravel admin20170819
 
Mongo - an intermediate introduction
Mongo - an intermediate introductionMongo - an intermediate introduction
Mongo - an intermediate introduction
 
Black Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data RetrievalBlack Hat: XML Out-Of-Band Data Retrieval
Black Hat: XML Out-Of-Band Data Retrieval
 
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...Replacing Oracle with MongoDB for a templating application at the Bavarian go...
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
 

Viewers also liked

CodeIgniter i18n Security Flaw
CodeIgniter i18n Security FlawCodeIgniter i18n Security Flaw
CodeIgniter i18n Security FlawAbbas Naderi
 
File upload for the 21st century
File upload for the 21st centuryFile upload for the 21st century
File upload for the 21st centuryJiří Pudil
 
How to insert json data into my sql using php
How to insert json data into my sql using phpHow to insert json data into my sql using php
How to insert json data into my sql using phpTrà Minh
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkToby Beresford
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkBo-Yi Wu
 

Viewers also liked (8)

Php acak
Php acakPhp acak
Php acak
 
CodeIgniter i18n Security Flaw
CodeIgniter i18n Security FlawCodeIgniter i18n Security Flaw
CodeIgniter i18n Security Flaw
 
File upload for the 21st century
File upload for the 21st centuryFile upload for the 21st century
File upload for the 21st century
 
File Upload 2015
File Upload 2015File Upload 2015
File Upload 2015
 
How to insert json data into my sql using php
How to insert json data into my sql using phpHow to insert json data into my sql using php
How to insert json data into my sql using php
 
Benefits of the CodeIgniter Framework
Benefits of the CodeIgniter FrameworkBenefits of the CodeIgniter Framework
Benefits of the CodeIgniter Framework
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
RESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP FrameworkRESTful API Design & Implementation with CodeIgniter PHP Framework
RESTful API Design & Implementation with CodeIgniter PHP Framework
 

Similar to CodeIgniter L5 email & user agent & security

The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applicationsDevnology
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsAleksandr Yampolskiy
 
Web application security
Web application securityWeb application security
Web application securityRavi Raj
 
Securing Your Webserver By Pradeep Sharma
Securing Your Webserver By Pradeep SharmaSecuring Your Webserver By Pradeep Sharma
Securing Your Webserver By Pradeep SharmaOSSCube
 
Code Igniter Security
Code Igniter Security Code Igniter Security
Code Igniter Security serezawa
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I thinkWim Godden
 
OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012ZIONSECURITY
 
XSS Primer - Noob to Pro in 1 hour
XSS Primer - Noob to Pro in 1 hourXSS Primer - Noob to Pro in 1 hour
XSS Primer - Noob to Pro in 1 hoursnoopythesecuritydog
 
Massive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on RailsMassive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on Railsibelmonte
 
Defending Against Attacks With Rails
Defending Against Attacks With RailsDefending Against Attacks With Rails
Defending Against Attacks With RailsTony Amoyal
 
Secure Programming
Secure ProgrammingSecure Programming
Secure Programmingalpha0
 
Open source security
Open source securityOpen source security
Open source securitylrigknat
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Jim Manico
 
PHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source ProjectPHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source Projectxsist10
 

Similar to CodeIgniter L5 email & user agent & security (20)

The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
Eight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programsEight simple rules to writing secure PHP programs
Eight simple rules to writing secure PHP programs
 
Web application security
Web application securityWeb application security
Web application security
 
Securing Your Webserver By Pradeep Sharma
Securing Your Webserver By Pradeep SharmaSecuring Your Webserver By Pradeep Sharma
Securing Your Webserver By Pradeep Sharma
 
Code Igniter Security
Code Igniter Security Code Igniter Security
Code Igniter Security
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
secure php
secure phpsecure php
secure php
 
OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012
 
Rails and security
Rails and securityRails and security
Rails and security
 
Security in php
Security in phpSecurity in php
Security in php
 
XSS Primer - Noob to Pro in 1 hour
XSS Primer - Noob to Pro in 1 hourXSS Primer - Noob to Pro in 1 hour
XSS Primer - Noob to Pro in 1 hour
 
Massive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on RailsMassive emailing with Linux, Postfix and Ruby on Rails
Massive emailing with Linux, Postfix and Ruby on Rails
 
Defending Against Attacks With Rails
Defending Against Attacks With RailsDefending Against Attacks With Rails
Defending Against Attacks With Rails
 
Secure Programming
Secure ProgrammingSecure Programming
Secure Programming
 
null Bangalore meet - Php Security
null Bangalore meet - Php Securitynull Bangalore meet - Php Security
null Bangalore meet - Php Security
 
Open source security
Open source securityOpen source security
Open source security
 
Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2Top Ten Java Defense for Web Applications v2
Top Ten Java Defense for Web Applications v2
 
PHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source ProjectPHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source Project
 
pop3-imap.ppt
pop3-imap.pptpop3-imap.ppt
pop3-imap.ppt
 
pop3-imap.ppt
pop3-imap.pptpop3-imap.ppt
pop3-imap.ppt
 

More from Mohammad Tahsin Alshalabi

More from Mohammad Tahsin Alshalabi (11)

NUMA optimized Parallel Breadth first Search on Multicore Single node System
NUMA optimized Parallel Breadth first Search on Multicore Single node SystemNUMA optimized Parallel Breadth first Search on Multicore Single node System
NUMA optimized Parallel Breadth first Search on Multicore Single node System
 
Learning Management System in Damascus University-Information Technology Engi...
Learning Management System in Damascus University-Information Technology Engi...Learning Management System in Damascus University-Information Technology Engi...
Learning Management System in Damascus University-Information Technology Engi...
 
Learning management system in information technology engineering faculty
Learning management system in  information technology engineering facultyLearning management system in  information technology engineering faculty
Learning management system in information technology engineering faculty
 
Moodle documentation
Moodle documentationMoodle documentation
Moodle documentation
 
Moodle plugins programing manual
Moodle plugins programing manualMoodle plugins programing manual
Moodle plugins programing manual
 
Comparison between web and mobile application requirements
Comparison between web and mobile application requirementsComparison between web and mobile application requirements
Comparison between web and mobile application requirements
 
Introduction to web services
Introduction to web servicesIntroduction to web services
Introduction to web services
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Php workshop L02 php basics
Php workshop L02 php basicsPhp workshop L02 php basics
Php workshop L02 php basics
 
Php workshop L01 CSS
Php workshop L01 CSSPhp workshop L01 CSS
Php workshop L01 CSS
 
Php workshop L0 Introduction
Php workshop L0 IntroductionPhp workshop L0 Introduction
Php workshop L0 Introduction
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

CodeIgniter L5 email & user agent & security

  • 1. Codeigniter Framework Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi 5. Email & User agent & Security
  • 2. Agenda • Email. • User agent. • Security. • Conclusion. Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 3. Email • Email class. • Sending Email. • Email class functions. Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 4. Email class • supports the following features. - Multiple Protocols: Mail, Sendmail, and SMTP. - Multiple recipients. - HTML or Plaintext email. - Attachments Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 5. Sending Email $this->load->library('email'); $this->email->from('your@example.com', 'Your Name'); $this->email->to('to@example.com'); $this->email->subject('Email Test'); $this->email->message('Testing the email class.'); $this->email->send(); Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 6. Email class functions • from() Sets the email address and name of the person sending the email. • to() Sets the email address(s) of the recipient(s). • subject() Sets the email subject. • message() Sets the email message body. • send() The Email sending function. Returns boolean TRUE or FALSE. Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 7. Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi Let’s Try It Live!
  • 8. User agent • User agent class. • Class functions. • Example. Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 9. User agent class • provides functions that help identify information about the browser, mobile device, or robot visiting your site. • Agent class is must initialize in your controller using as following: $this->load->library('user_agent'); Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 10. Class functions • $this->agent->is_browser() • $this->agent->is_mobile() • $this->agent->is_robot() • $this->agent->browser() • $this->agent->mobile() • $this->agent->robot() • $this->agent->platform() Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 11. Example $this->load->library('user_agent'); if ($this->agent->is_browser()){ $agent = $this->agent->browser(); }elseif ($this->agent->is_robot()){ $agent = $this->agent->robot(); } echo $agent; Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 12. Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi Let’s Try It Live!
  • 13. Security • URI Security • Error reporting • XSS Filtering • Data escape • Data validation Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 14. URI Security • minimize the possibility that malicious data can be passed to your application. • URIs may only contain the following: Alpha-numeric text Tilde: ~ Period: . Colon: : Underscore: _ Dash: - Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 15. Error reporting • it is typically desirable to disable PHP's error reporting by setting the internal error_reporting flag to a value of 0. • This disables native PHP errors from being rendered as output, which may potentially contain sensitive information. Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 16. XSS Filtering • CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter all POST and COOKIE data that is encountered, or you can run it on a per item basis • Loading security helper $this->load->helper('security'); Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 17. XSS Filtering • xss_clean(): Provides Cross Site Script Hack filtering. to run automatically every time it encounters POST or COOKIE data you can enable it by set this in config file $config['global_xss_filtering'] = TRUE; Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 18. XSS Filtering • sanitize_filename(): Provides protection against directory traversal. • Enable csrf protection: by setting this in config file $config['csrf_protection'] = TRUE; Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 19. Data escape • Escape data before inserting it into database. • $this->db->escape() This function determines the data type so that it can escape only string data. • $this->db->escape_like_str() This method should be used when strings are to be used in LIKE conditions Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 20. Data validation • Validating, Filtering, and Prepping data • We saw this in session 2 : ) Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 21. Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi Let’s Try It Live!
  • 22. Conclusion Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi
  • 23. THANK YOU Mhd Opada Al-Bosh & Mhd Tahsin Al-Shalabi Questions?