[Quick Links] |
Search Site

Site Details

rendered in 0.1011 secs

Captain's Log | Wednesday 13th of September 2017

git public key denied | ssh repo push pull

cat /home/dave111/.ssh/id_rsa.pub >> /home/novajizz/.ssh/authorized_keys

rss2email r2e rss2mail how to add new feed

r2e add friendlyname http://www.gsmarena.com/rss-news-reviews.rss e@mailaddress.io

r2e config file location | src

~/.config/rss2email.cfg

codeigniter form validation check if exists callback

        public function optionsForm() {
            $this->load->library('form_validation');
            $this->form_validation->set_rules('email', 'Email Address', 'valid_email|trim|required|xss_clean|callback_checkEmailExists');
            $this->form_validation->set_rules('hideOffline', 'Hide Offline Nodes', 'xss_clean');

            if($this->form_validation->run() == FALSE) {
                $this->options();
            } else {
                $data = array(
                    'email'         => $this->input->post('email'),
                    'hideOffline'   => $this->input->post('hideOffline'),
                );
                $this->db->where('id', $this->session->userdata('user_id'));
                $this->db->update('user', $data);

                $new_session_data = array(
                    'hideOffline'   => $this->input->post('hideOffline'),
                    'user_email'    => $this->input->post('email'),
                ); //update current session data
                $this->session->set_userdata($new_session_data);
                $this->session->set_flashdata('message', 'Configuration saved at '.date('H:i:s'));
                redirect(base_url()."user_options/options"); //if you just load $this->options the flashmessage is like one refresh behind
            }

        }

        public function checkEmailExists() {
            $this->db->where('email', $this->input->post('email'));
            $emailCheckExist = $this->db->get('user');
            if($emailCheckExist->num_rows() > 0) {
                $this->form_validation->set_message('checkEmailExists', 'Email address is already in use by another account.');
                return FALSE;
            } else {
                return TRUE;
            }
        }