This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

time restricted login module?

I have a research website project coming up. One thing that I need to be able to do is, restrict the times that one user group can log in to a spacific part of the day. Has anyone done this before? Thanks in advance for any help.

-Staren

Need Help using the cpanel.module

Not working at all. I'v installed the module into the modules directory and enabled it also I enabled the creation of email accounts for each user and disabled the creation of ftp accounts and nothing happened.

I don't think it has something to do with my host because I previously used the following code and it worked well:

<?php

include 'config.php';

// if form has been submitted
if(isset($_POST['submit'])) {
$newmail_str = ""; // $newmail_str is the string we'll append entries to
if (!$_POST['fname'] | !$_POST['lname'] | !$_POST['password1'] | !$_POST['password2'] | !$_POST['altmail'] | !$_POST['newmail']) {
die('You did not fill in a required field.');
}

// check passwords match

if ($_POST['password1'] != $_POST['password2']) {
die('Passwords did not match.');
}

// check e-mail format

if (!preg_match("/.*@.*..*/", $_POST['altmail']) | preg_match("/(<|>)/", $_POST['altmail'])) {
die('Invalid e-mail address.');
}

// no HTML tags allowed

$_POST['fname'] = strip_tags($_POST['fname']);
$_POST['lname'] = strip_tags($_POST['lname']);
$_POST['newmail'] = strip_tags($_POST['newmail']);
$_POST['password2'] = strip_tags($_POST['password2']);
$_POST['altmail'] = strip_tags($_POST['altmail']);

if (!get_magic_quotes_gpc()) {
$_POST['fname'] = addslashes($_POST['fname']);
$_POST['lname'] = addslashes($_POST['lname']);
$_POST['username'] = addslashes($_POST['username']);
$_POST['password2'] = addslashes($_POST['password2']);
$_POST['altmail'] = addslashes($_POST['altmail']);
}

// Put post fields variable together for Curling....bad joke ;)
$postfields = "email=$eEmail&domain=$eDomain&password=$ePassword&quota=$eQuota";
// initialise Curl
$popPost = curl_init();
// Set Curl Option: URL
$url="http://$domain:2082/frontend/$theme/mail/doaddpop.html";
curl_setopt($popPost, CURLOPT_URL, $url);
// Set Curl Option: Username:Password
curl_setopt($popPost, CURLOPT_USERPWD, "$username:$password");
// Set Curl Option: Post style request = true
curl_setopt($popPost, CURLOPT_POST, 1);
// Set Curl Option: Collect result from script
curl_setopt($popPost, CURLOPT_RETURNTRANSFER, 1);
// Set Curl Option: Set timeout to 15 seconds
curl_setopt($popPost, CURLOPT_TIMEOUT, 15);
// Set Curl Option: Post data
curl_setopt($popPost, CURLOPT_POSTFIELDS, $postfields);

//output results
$popPost_result = curl_exec ($popPost);

// Close Curl
curl_close ($popPost);

// Output Curl results
$start = strpos($popPost_result, 'Account');
$end = strpos($popPost_result, 'created.');
$subset = substr($popPost_result, $start, $end+8-$start);
$subset = str_replace('login ', "login
", $subset); //for neatness
//$subset=str_replace(" if (preg_match ('/Sorry/i', "$subset")) {
print "
Sorry that account already exists.

Back";
//print ($subset);
}

elseif(preg_match ('/You must specify/i', "$subset")) {
print "
You must specify a password.

Webform permissions not working

Help,
Users who are only assigned rights to access webform results are then able to delete submissions of others in the view submissions mode. Anyone else had this problem? I tried deleting the all of the webform tables from the database (including the one from the system table) and reinstalling the module but to no avail. One way around it would be if there was a way to have the webform table of submissions be shown on a seperate page (node)? Thanks,
John

Affiliate Tracking for sign-ups, Integration of 3rd party Affiliate scripts?

Hi folks,

I'm currently researching ways to implement an affiliate system for a site

goals:

- pay affiliates for user signups (lead generation - fixed amount per unique approved user)
- pay affiliates for completed sales (pay for performance)

(so all normal PayPerclick and PayPerVisit systems fail)

design/probs:

i18n & poll.module

when using multiple-languages on the poll content-type, I discovered that poll results were not combined between languages.

this can be fixed by adding the following 13 lines of code to your poll.module

                $poll = node_load(array('type' => 'poll', 'created' => $timestamp, 'moderate' => 0, 'status' => 1));
						
		/***
		 * chris hack:  for i18n polls, add up the values of all other polls 
		 * from differnet languages.  NOTE:  this assumes that each languages 
		 * corresponding choices are in teh SAME ORDER!!!
		 * 
		 * check for translation with $node->translation
		 */
		if (isset($poll->translation)) {
			foreach ($poll->translation as $tr) {
				$trNode = node_load(array('nid' => $tr->nid) );
				foreach ($trNode->choice as $k => $choice_k) {					
					foreach ($poll->choice as $n => $choice_n) {
						if ($poll->choice[$n]['chorder'] == $trNode->choice[$k]['chorder']) {						
							$poll->choice[$n]['chvotes'] += $trNode->choice[$k]['chvotes'];
							break;	
						}	
					}	
				}
			}
		}
		/*** END HACK ***/

                if ($poll->nid) {
                      // poll_view() dumps the output into $poll->body.
                     poll_view($poll, 1, 0, 1);
                }

App interface module (simple)

Hello,
I need to create a module has two purposes and multiple ways of output.

First, I need to create a new nodetype. The nodetype needs the following fields Title and URL. This node will be viewable by all, however it will only be created by admin's or people with special rights (I understand how to do this part via admin/access).

However it becomes more complex than this. I need to be able to allow users to subscribe to the nodes of the nodetype created. When the user subscribes (via checkbox and submit most likely), drupal needs to update a page such as SITEURL/user/USERID/urlapp, obviously SITEURL is the URL for where drupal is, and the USERID is there user number. This page would be simple xml output that listed all the subscriptions with a title tag with the title between (which is defined when the node is created) and URL tag with the URL between (which is defined when the node is created). Additionally, when a user subscribes to the url, an additional entry for the subscribed url will be added on SITEURL/user/USERID/subscribedurls which links to the node for the subscribed url. Also, a subscribed count is needed for this.

The page at SITEURL/user/USERID/urlapp would be used for a application created by me.

I know this can be done, however I'm not one willing to tackle it because I'm just starting to work beyond premade simple stuff, and this is beyond my understanding of drupal.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions