The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/portal.php 39 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 1,007
» Latest member: kavitasinghji
» Forum threads: 1,324
» Forum posts: 7,788

Full Statistics

Online Users
There are currently 510 online users.
» 0 Member(s) | 508 Guest(s)
Bing, Google

Latest Threads
UserSpice Alpha Testing a...
Forum: News Center
Last Post: ivinsons
11-08-2024, 06:13 PM
» Replies: 13
» Views: 42,475
UserSpice 4.4 Development
Forum: News Center
Last Post: Amelie12
09-21-2024, 12:23 PM
» Replies: 4
» Views: 15,199
Welcome to the new UserSp...
Forum: News Center
Last Post: ivinsons
08-25-2024, 07:39 AM
» Replies: 2
» Views: 27,918
How to use hasPerm
Forum: UserSpice 4.4
Last Post: mudmin
07-20-2019, 02:45 PM
» Replies: 1
» Views: 13,755
Session issue? What I sho...
Forum: UserSpice 4.4
Last Post: Parth
07-17-2019, 05:06 PM
» Replies: 4
» Views: 14,502
Email Error
Forum: UserSpice 4.4
Last Post: Brandin
07-17-2019, 04:47 PM
» Replies: 1
» Views: 6,623
{ Missing Text } after up...
Forum: UserSpice 4.4
Last Post: Brandin
07-16-2019, 04:23 PM
» Replies: 22
» Views: 53,638
Best Practice Info
Forum: New to UserSpice?
Last Post: Brandin
07-16-2019, 11:55 AM
» Replies: 1
» Views: 13,490
Force to use 2FA -always-
Forum: UserSpice 4.4
Last Post: Brandin
07-12-2019, 12:43 PM
» Replies: 1
» Views: 6,636
e-mail not verifying
Forum: UserSpice 4.4
Last Post: LBC
07-10-2019, 11:34 AM
» Replies: 31
» Views: 76,232

 
  Integrating into template
Posted by: lefox - 04-03-2017, 07:11 AM - Forum: Off-topic Discussions - Replies (4)

This might be waaay to much to ask, but I downloaded this template

Template

and I wanted to incorporate it into the front end of my website.

How ever when I added the

<pre>

Code:
require_once 'init.php';
require_once $abs_us_root.$us_url_root.'users/includes/header.php';
</pre>


but it errors out every time!

Code:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Program Files\VertrigoServ\www\snv\usersc\index.php:3) in C:\Program Files\VertrigoServ\www\snv\usersc\init.php on line 2

Code:
Cannot modify header information - headers already sent by (output started at C:\Program Files\VertrigoServ\www\snv\usersc\index.php:3) in C:\Program Files\VertrigoServ\www\snv\users\includes\header.php on line 3


If you look at the index.html(changed to index.php when I'm trying it) its got a bunch of header stuff:

<pre>
Code:
<!-- Google Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800" rel="stylesheet">
  
  <!-- Bootstrap CSS File -->
  <link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  
  <!-- Libraries CSS Files -->
  <link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  <link href="lib/animate-css/animate.min.css" rel="stylesheet">
  
  <!-- Main Stylesheet File -->
  <link href="css/style.css" rel="stylesheet">
</pre>


I've tried adding these to init.php or header.php(I'm not sure which one).

It seemed to load a bit more properly when I added style.css as the custom css.

This is probably a lot to ask but if you had any suggestions it would really help!


  how to prepare?
Posted by: gaby de wilde - 04-01-2017, 10:24 AM - Forum: UserSpice 4.3 and Below - Replies (4)

I have this

https://pastebin.com/j06N2nf6

I can replace the $conn with

require_once 'users/init.php';
$conn = DB::getInstance();

That works just fine.

But how do I get the user_id inthere?

I get that this should do the trick.

$user_id = (isset($user) && $user->isLoggedIn())? $user->data()->id : 0;

But if I add these requires to the file things stop working.

require_once $abs_us_root.$us_url_root.'users/includes/header.php';
require_once $abs_us_root.$us_url_root.'users/includes/navigation.php';


  Setting up Facebook
Posted by: steev - 03-29-2017, 06:48 PM - Forum: UserSpice 4.3 and Below - No Replies

The Facebook setup instructions here https://userspice.com/documentation-social-logins/ don't seem to match what I'm seeing. I got the Google API setup but the Facebook API is causing me some trouble.

Can you verify the instructions and setup?

Also, would I need to put the "Facebook callback URL" from Userspice into both the redirect URIs and the deauthorize callback URL fields ?

[Image: 2a2g9Je.png]


  user summit Record's
Posted by: sire - 03-29-2017, 03:51 PM - Forum: Documentation - Replies (1)

im working on a user summit Record's and only they can see the Record and no one els

so im wondering is what is the beat way to how make this work i was thinking of using the users "email" or "ID"?? case username can change though i can make it that the username cant change

what is your input?

thanks,
sire


  Help with $dv->update
Posted by: muhammedc - 03-29-2017, 12:47 PM - Forum: UserSpice 4.3 and Below - Replies (3)

Hi

So heres the code I am using... but it doesnt seem to update the db... I cant seem to figure out where I am going wrong:

require_once $abs_us_root.$us_url_root.'users/classes/DB.php';'

$db = DB::getInstance();
$updatestatus = Input::Get('update');
$qid = Input::Get('id');

if ($updatestatus != 1) {
$fields = array(
'author' => $user->data()->id,
'filenumber' => Input::get('internal'),
'content' => Input::get('letterbody'),
'webkey' => Token::generate(),
);
$db->insert('letters',$fields);
Redirect::to('lettersearch.php?msg=Letter+Saved!');
}
else {
$fields = array(
'lastupdatedby' => $user->data()->id,
'filenumber' => Input::get('internal'),
'content' => Input::get('letterbody'),
);

$db->update('letters',$qid,$fields);
dump ($fields);
Redirect::to('lettersearch.php?msg=Letter+Updated!');
}


Any ideas what I am not seeing? There are no errors. If I goto the database, any changes made in any of the fields above do not get updated...


  static html
Posted by: gaby de wilde - 03-28-2017, 08:25 PM - Forum: Modifications and Hackery - Replies (1)

hello!

Thank you for writing this cool user management software.

I'm not entirely sure if this is free from bugs, maybe you see something wrong with it but here goes:

In users/includes/navigation.php I've added

Code:
<?php if($user->isLoggedIn()){     //anyone is logged in?>
Code:
<script>document.cookie="loggedin=1;path=/;example.com"</script>


And:

Code:
<?php }else{ // no one is logged in so display default items ?>
Code:
<script>document.cookie="loggedin=0;path=/;host=example.com"</script>



(you have to put your domain name where it says example.com)

In users/logout.php at the top:

Code:
setcookie("loggedin","0",time()+500,"/");

and a bit lower:

Code:
$user->logout();
Code:
session_destroy();



On other pages (in the body) I've added:

Code:
<script>
Code:
var sheet = document.createElement('style');
Code:
sheet.innerHTML = document.cookie.indexOf('loggedin=1')!=-1?".out{display:none}":".in{display:none}";
Code:
document.head.appendChild(sheet);
Code:
</script>
Code:
<a href="/">home</a> &nbsp; &nbsp;
Code:
<a href="users/logout.php" class="in">logout</a>
Code:
<span class="out">
Code:
<a href="users/login.php">login</a> &nbsp; &nbsp;
Code:
<a href="users/join.php">register</a> &nbsp; &nbsp;
Code:
<a href="users/forgot_password.php">forgot password</a>
Code:
</span>



The advantage of doing it like this is that beyond logging in and out it doesn't require any php.

One can have completely static html documents that, when logged out displays:

home | login | register | forgot password

While when logged in you get:

home | logout

(The admin page I keep on the bookmarks toolbar)

The point of using static html:

1) you can have a lot of traffic with the server doing very little work.
2) php can beak in countless different ways.
2.1) I hardly ever write php without any mistakes. The html continues to work.
2.2) php is frequently updated, webhosts tend to wait for you to go on vacation then break everything.
2.3) usespice might have a bug in it. (I'm not counting on it but I'd say a non zero chance)
2.4) your database might get corrupted.
2.5) someone might hack your site.
3) static html is amazingly fast

I like to keep things as simple as possible partially because I'm not very good at php, I haven't really looked into all the userspice helper functions and I don't know how to use bootstrap. I could include all that in pages that use only the isloggedin thingy but that, with much love and respect, seems rather silly.

Hope this is useful Smile


  I use an index to call my pages and the premission doesn't work
Posted by: kwix - 03-28-2017, 05:54 AM - Forum: Documentation - Replies (5)

Hi,

Im using an index page which is calling all the pages that i want. For exemple when i click on a lick my url is like

Code:
index.php?page=APage.php&projectName=name
As you can see im getting different parameters and when i set the page "APage.php" to private, it doesn't work, i still can access to the page.

Here a part of the code of my index.php

<div id="wrapper-wrapper">
<?php require("partials/nav.php"); ?>
<div id="page-wrapper" class="admin">
<?php
if (!isset($_GET['page'])){
require("pages/main.php");
}else{
if(isset($_GET['page']) && preg_match("/^[-a-z0-9_&]+$/i",$_GET['page'])){
$page=strtolower($_GET['page']);
if (file_exists("pages/$page.php")){
require ("pages/$page.php");
}else if(file_exists("admin/pages/$page.php")){
require ("admin/pages/$page.php");
}else{
require ("pages/404.php");
}
}else{
require ("pages/404.php");
}
}
?>
</div>
</div>


How can i use the permission without modifying all my php pages ?

Regards,


  Allowing dynamic pages
Posted by: Jakes - 03-27-2017, 09:14 AM - Forum: UserSpice 4.3 and Below - Replies (5)

Good day

I am quite new to userspice. I would like to be able to allow all dynamically generated pages without having to add them to the database after identifying them.

I am using the CodeIgniter framework, which creates new "pages" for each item in a dynamic list. For example /users/1, /users/2, /users/3 will represent a different user that is being viewed. The list of users can be infinitely long, therefore I do not want to add all the possible options to the database. I would only like to allow everything "under" /users. Something like /users/*

Any help would be appreciated.

Kind regards
Jakes


  Copying lang Function
Posted by: Brandin - 03-23-2017, 02:38 PM - Forum: Modifications and Hackery - No Replies

Hey!

I love changing things you make! Just kidding I'm just copying what you make now...I have a templates page I use for work and other agents use it too, so I want to make a page with a input field and submit button called "name" for example, it posts back to the page and that will be the array for one of x amount of templates. I then want it to pull the template from the db and replace the markers with the name, there would only ever be 1 marker.

E.g. I have 6 templates, all named differently, with a {3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}m1{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}, I want to pull the templates from the DB, which I am sure I can figure out but when I pull each template, I need it to do the marker replacement IF there is markers. Thoughts on how I can do this?

Thank you!


  Adding new pages
Posted by: Ahmed - 03-22-2017, 03:40 PM - Forum: UserSpice 4.3 and Below - Replies (4)

Hello,

i installed UserSpice v4.2.2 and trying to add new pages. I already know that, they can be moved under folder 'users' and added in the database and then they appear under pages in admin-dashboard.

what i want exactly to do is, to add a new home for the pages just like users but not users Smile ?

Thx in advance.